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

Why is this script failing to teleport my characters?

Asked by 10 years ago

So I am trying to get this script to teleport players at a certain time to bricks called "Spawns" in my game. The problem is that the teleport part of the script isn't working.....

In the output it says the problem is that...."'Spawns' (a nil value)" even though they are in the game.

Also, it says that the problem lies here: check:MoveTo(spawns[i].Position)

spawns = gameChosenClone.Spawns:GetChildren() for i,v in pairs(game.Players:GetPlayers()) do name = v.Name check = game.Workspace:FindFirstChild(name) if check then checkHumanoid = check:FindFirstChild("Humanoid") if checkHumanoid then check:MoveTo(spawns[i].Position) end end end

Answer this question