-- 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
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