RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"Teleport the player a few inches behind his self from the part"
-- local script for teleporting the player local part = script.Parent local function teleportPlayer(otherPart) local player = game.Players:FindFirstChild(otherPart.Parent.Name) if player then local character = player.Character local humanoidRootPart = character:FindFirstChild("HumanoidRootPart") if humanoidRootPart then local newPosition = humanoidRootPart.Position - humanoidRootPart.CFrame.lookVector * 5 newPosition = newPosition + Vector3.new(0, 2, 0) humanoidRootPart.CFrame = CFrame.new(newPosition) end end end part.Touched:Connect(teleportPlayer)