I have a script that is running "while true do" but I need another script to stop the loop and disable the script, but I cant figure out how to do it, No matter what I try.
This is the script. What would I do in another script to make it stop the script from running, and then disable this script?
ELS = script.Parent
while true do
wait(0)
if ELS.lbon.Value == 1 then
ELS.Lightbar1.FLBR.Transparency = 0
ELS.Lightbar1.LB1.Transparency = 0
ELS.Lightbar1.LB2.Transparency = 0
ELS.Lightbar1.LB3.Transparency = 0
ELS.Lightbar1.LB4.Transparency = 0
ELS.Lightbar1.FLBL.Transparency = 0
elseif ELS.lbon.Value == 2 then
ELS.Lightbar1.RLBR.Transparency = 1
ELS.Lightbar1.FLBR.Transparency = 0
ELS.Lightbar1.LB1.Transparency = 1
ELS.Lightbar1.LB2.Transparency = 0
ELS.Lightbar1.LB3.Transparency = 1
ELS.Lightbar1.LB4.Transparency = 0
ELS.Lightbar1.FLBL.Transparency = 1
ELS.Lightbar1.RLBL.Transparency = 0
wait(0.2)
ELS.Lightbar1.RLBR.Transparency = 0
ELS.Lightbar1.FLBR.Transparency = 1
ELS.Lightbar1.LB1.Transparency = 0
ELS.Lightbar1.LB2.Transparency = 1
ELS.Lightbar1.LB3.Transparency = 0
ELS.Lightbar1.LB4.Transparency = 1
ELS.Lightbar1.FLBL.Transparency = 0
ELS.Lightbar1.RLBL.Transparency = 1
wait(0.2)
ELS.Lightbar1.RLBR.Transparency = 1
ELS.Lightbar1.FLBR.Transparency = 0
ELS.Lightbar1.LB1.Transparency = 1
ELS.Lightbar1.LB2.Transparency = 0
ELS.Lightbar1.LB3.Transparency = 1
ELS.Lightbar1.LB4.Transparency = 0
ELS.Lightbar1.FLBL.Transparency = 1
ELS.Lightbar1.RLBL.Transparency = 0
wait(0.2)
ELS.Lightbar1.RLBR.Transparency = 0
ELS.Lightbar1.FLBR.Transparency = 1
ELS.Lightbar1.LB1.Transparency = 0
ELS.Lightbar1.LB2.Transparency = 1
ELS.Lightbar1.LB3.Transparency = 0
ELS.Lightbar1.LB4.Transparency = 1
ELS.Lightbar1.FLBL.Transparency = 0
ELS.Lightbar1.RLBL.Transparency = 1
wait(0.2)
elseif ELS.lbon.Value == 3 then
ELS.Lightbar1.RLBR.Transparency = 1
ELS.Lightbar1.FLBR.Transparency = 1
ELS.Lightbar1.LB1.Transparency = 1
ELS.Lightbar1.LB2.Transparency = 1
ELS.Lightbar1.LB3.Transparency = 1
ELS.Lightbar1.LB4.Transparency = 1
ELS.Lightbar1.FLBL.Transparency = 1
ELS.Lightbar1.RLBL.Transparency = 1
end
end

3 comments
There's definitely another way of doing this. You should avoid wait(n) for example, wait(1) could wait longer depending on your FPS.
MarkedTomato got too far you can use wait() but it's just not recommended
MarkedTomato and Xapelize- that is not my problem though. Please contribute to my question