hello im new to scripting and im trying to make a script that makes lightning appear and disappear for a quick second but it keeps looping and idk why heres my script
while true do wait(.1) script.Parent.Transparency = 1 wait(4.5) script.Parent.Transparency = 0 wait(.1) script.Parent.Transparency = 1 end
While true do is a loop.
wait(.1) script.Parent.Transparency = 1 wait(4.5) script.Parent.Transparency = 0 wait(.1) script.Parent.Transparency = 1
that won't loop it.
Note: you say for a quick second? "wait(4.5)" waits 4 and a half seconds
this repeats the lightning until a certain moment
local a = 0 repeat wait(.1) script.Parent.Transparency = 1 -- so right now, you can't see the lightning wait(4.5) script.Parent.Transparency = 0 -- then u wait 4.5 secs before the lightning appears wait(.5) -- i changed that so the lightning actually lasts longer script.Parent.Transparency = 1 -- finally after .5 seconds of lightning, the lightning disappears a = a + 1 print(a) until a == 20
^ that will keep changing a by one until it reaches twenty in two minutes and two seconds EXACT it will stop i even added a print(a) so you can keep track of how long it is before it stops
Thanks, by greatneil80
remember to accept this post if it works