I was messing around with some scripts, and when I tried something with the for i = 1, 20 do stuff, it crashed. the script:
for i = 1, 20 do script.Parent.BrickColor = BrickColor.new("New Yeller") wait() end while true do for i = 1, 20 do script.Parent.BrickColor = BrickColor.new("Lime green") wait() end for i = 1, 20 do script.Parent.BrickColor = BrickColor.new("New Yeller") wait() end
If a script usually a Loop (repeat, while true do, until) all need some sort of delay or else the script fires extremely fast and causes the studio to lag up
While true do is honestly useless because even if you do
While true do wait(1) --script here
is easily replaced by
While wait(1) do --script here
clears up code and works way better
remove the"while true do". Add a delay there, such as while wait(0.6).