First I created an Instance to create the Hint, then I created the function, then placed a Loop to serve as the countdown. Like this
for i = 1, 11 do
sp.Text = sp.Text -1
wait(1)
end
When I tried to add when the countdown reaches 0, players move to a certain spot and it doesn't work
Please help!
You gave us little info, but from what I'm getting from your question, this is what I think you want
for i = 11, 1, -1 do sp.Text = i wait(1) end for i,v in pairs(game.Player:GetChildren()) do v.Character:MoveTo() -- put coordinates between the parentheses. end
We need more information to properly help you (ex what errors are you encountering (check the Output box if in studio or press F9 for the developer console in online mode))? What happens when you run it vs what you want to have happen?), but there is a bug in the code you've shown: you can't do arithmetic on strings. That is, "sp.Text" is a string, but you're trying to subtract 1 from it.
Instead, refer to the 'i' variable, and perhaps have the for loop count down instead of up:
for i = 11, 1, -1 do sp.Text = i wait(1) end
(Note that lua automatically converts the number to a string in this case).
Also note that Hints (created via Instance.new("Hint")) are deprecated and could theoretically be removed from Roblox in a future update.
i wouldn't do move to because it can cause problems. Just Change the CFrame of the players torsos.