Once the tool handle hits the block, I want it to wait a few seconds then teleport everyone to the new position. I'm trying to do this but each time I test it, it doesn't work. The script is giving me an error as well that says forgot to close then and do. Here's my script so far.
script.Parent.Touched:connect(function(hit) if hit.Name == "Handle" then wait(3) local p = game.Players:GetChildren() for i = 1, #p do p[i].Character:MoveTo(Vector3.new(0, 38.8, 1)) end
Try this for teleporting the players instead:
script.Parent.Touched:connect(function(hit) if hit.Name == "Handle" then wait(3) for a, b in pairs(game.Players:GetPlayers() do b:WaitForChild("Character"):WaitForChild("HumanoidRootPart").CFrame = CFrame.new(Vector3.new(0, 38.8, 1)) end end end)
Also it looks like you're missing an end at the end of your script, maybe add this after the end in your script: end)?