##Your problems
You have a couple problems with your script. The first is that you used the for statement incorrectly. It would work like this, just not the way you want it to. Your second problem comes in when you're trying to move the players.
##Fix
Ok, so for the first part, we simply want it to wait one second for each iteration, and then update the text. To do that, we'll shorten the for statement down to this:
local players = game.Players:GetPlayers()
for test1 = 10, 1, -1 do
test2 = Instance.new("Hint", game.Workspace)
test2.Text = "There is " ..test1.. " seconds left"
wait(1)
game.Workspace.Message:remove()
end
Now that's fixed, and will work how you want it to. Here's for the next part. Here, we'll teleport each player individually to the brick:
wait(1)
for _,Player in pairs(players) do
Player.Character:MoveTo(game.Workspace.SpeedBrick.Position)
end
Now, this should work as well. It is another for statement that iterates over each player, and moves them to the brick. So, let's put it together, and for the final result we get this:
local players = game.Players:GetPlayers()
for test1 = 10, 1, -1 do
test2 = Instance.new("Hint", game.Workspace)
test2.Text = "There is " ..test1.. " seconds left"
wait(1)
game.Workspace.Message:remove()
end
wait(1)
for _,Player in pairs(players) do
Player.Character:MoveTo(game.Workspace.SpeedBrick.Position)
end
There ya go
Ok, so now it should work. If you have any further problems/questions, please leave a comment below. Hope I helped :P
####-Dyler3
1 comment
for some reason it didn't work. All it does it just countdown from 10?! Can you please fix this? :)