Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Script won't teleport the player, help?


script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")then
	
game.ReplicatedStorage.Teleport1:FireClient(game.Players:GetPlayerFromCharacter(hit.Parent))

wait(1)
 game.Workspace:WaitForChild(game.Players.LocalPlayer.Name).Torso.CFrame = CFrame.new(-188.16, 39.299, -234.1)
end
end)

1 answer

✓ Accepted answer

You need to use :MoveTo(), I'll provide an example below:

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
hit.Parent:MoveTo(Vector3.new(-188.16,39.299,-34.1))
end
end)

Typed on mobile and couldn't test so sorry for any mistakes if any.

2 comments

0

thank

0

The ~= nil isn't necessary, you can just do hit.Parent:MoveTo(vec3) and it should work.

This discussion is preserved as it was. New answers, comments, and votes are closed.