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

I can't figure out why a player isn't moving in a MoveTo script help?

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")then
script.Parent.Parent.Parent.StarterGui.ScreenGui2.Enabled=true

local player = game.Players.LocalPlayer

game.Workspace:WaitForChild(player).UpperTorso.CFrame = CFrame.new(-691.31, 4.453, -740.24)

end
end)







I made this script I suck sorry :c

1 comment

0

Is this a LocalScript or a ServerScript? Also, :MoveTo() can only work on Models (including the player's Character Model) and a Humanoid

1 answer

hello

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")then
script.Parent.Parent.Parent.StarterGui.ScreenGui2.Enabled=true

local player = game.Players.LocalPlayer

game.Workspace:WaitForChild(player.Name).UpperTorso.CFrame = CFrame.new(-691.31, 4.453, -740.24)

end
end)

--WaitForChild take strings. the variable player is an object and your putting that as ur argument in waitforchild





u could also have it a moveto

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid")then
script.Parent.Parent.Parent.StarterGui.ScreenGui2.Enabled=true

local player = game.Players.LocalPlayer

game.Workspace:WaitForChild(player.Name).Humanoid:MoveTo(Vector3.new(-691.31, 4.453, -740.24))

end
end)

2 comments

0

and btw changing startergui doesn't do anything u need to change playergui

0

does nothing..

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