Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Script won't teleport the player, help?

Asked by
bailley5 114
3 years ago

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

Log in to vote
0
Answered by
Axenori 124
3 years ago

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.

0
thank bailley5 114 — 3y
0
The ~= nil isn't necessary, you can just do hit.Parent:MoveTo(vec3) and it should work. brokenVectors 525 — 3y
Ad

Answer this question