How can I make a timer for fireworks? I have this so far:
PARTE = script.Parent.America wait(7) script.Parent.Anchored=false wait(2) script.Parent.Anchored = true script.Parent.Transparency = 1 PARTE.Enabled = true wait(.5) PARTE.Enabled = false wait(2) script.Parent:Destroy()
I want to make it that every 180 seconds the firework goes off again.
Use a while
loop.
This is a type of loop that will run until the given condition is false
, so by making the condition always true
, you can make it run infinitely.
while true do -- fireworks wait(180) end
Note that if your infinite while
loop does not have a wait
in it, it will crash your game.
EDIT: This is what it should look like:
while true do PARTE = script.Parent.America wait(7) script.Parent.Anchored = false wait(2) script.Parent.Anchored = true script.Parent.Transparency = 1 PARTE.Enabled = true wait(.5) PARTE.Enabled = false -- I removed the destroy part since it would stop the code from running more than once wait(180) end
Hope I helped!
~TDP