Posted this yesterday, I guess I had to be way specific. Im trying to make the Player, Move to an Specified Part, then after 5 seconds Move to other.
when Stepping on a part - Go to other - After 5 seconds - Go back!
local Member = game.Players.LocalPlayer local Target = game.Workspace.Here local Out = game.Workspace.out function onTouch(hit) workspace.Member.Humanoid:MoveTo(Target.Position, Target) wait(5) workspace.Member.Humanoid:MoveTo(Out.Position, Out) end script.Parent.Touched:connect(onTouch)
**And yes. The Script is in a LocalPlayer ** The thing is that when the part it's touched. Nothing happengs.
You are welcome.
repeat wait() until game.Players.LocalPlayer.Character local Member = game.Players.LocalPlayer local Target = game.Workspace.Here local Out = game.Workspace.out game.Workspace.TouchPart.Touched:connect(function(hit) Member.Character.Humanoid:MoveTo(Target.Position) wait(5) Member.Character.Humanoid:MoveTo(Out.Position) end)
You will not be able to move the player by their humanoid so instead you must use their torso because it is the root of the player's body which means it will transfer everything it holds. I also made some other changes because you had many other mistakes in your script that I can't really explain (I'm terrible at explaining so pardon my dust).
local Member = game.Players.LocalPlayer local Target = game.Workspace.Here local Out = game.Workspace.out function onTouch() Member.Character.Torso.CFrame = CFrame.new(Target.Position) wait(5) Member.Character.Torso.CFrame = CFrame.new(Out.Position) end game.Workspace.TouchPart.Touched:connect(onTouch)
This is a LocalScript in StarterGui.