-- The parent is TextLabel, TextLabel's parent is ScreenGui, ScreenGui's parent is StarterGui
Timer = 0
while Timer <10 do
Timer = Timer + 1
Wait(1)
script.Parent.Text = (Timer)
end
-- This is the part that isn't working (below)
while Timer == 10 do
wait(1)
Game.workspace.Sound:play()
wait(1)
Timer = Timer - 9
wait(10)
script.Parent.Text = (Timer)
end
✓ ANSWER ACCEPTED
How can I make it so when it reaches ten, the restart script works?
2 answers
✓ Accepted answer
Try this
Timer = 0
while Timer < 10 do
Timer = Timer + 1
wait(1)
print(Timer)
if Timer == 10 then
Timer = 0
game.Workspace.Sound:play()
wait(1)
end
end
using if statements is easier than what you did. If this does work please hit the [Accept Answer] button below.
for i = 0, 10, 1 do
Timer = i
wait(1)
if Timer == 10 then
game.Workspace.Sound:Play()
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
I don't know why it's not showing it in the roblox format. Sorry
You can put it in a code block (the button with the Lua symbol) to show it in code format.
Edited to put the code in a code block.