I’m working on a brownout where all lights decreases and turns back to normal in a short time.
for i, v in pairs(workspace.Lights:GetChildren()) do
if v.ClassName == "Model" then
the reason why I’m confident about it’s all about wait() is because when I remove string 4 and 5 (wait() and the one that sets .Brightness to 2 back again) it decreases the brightness to 0.2, so the script actually works properly but ignores the 1 second delay and immediately sets the .Brightness to 2 which is not the thing I exactly want.
Nope, still doesn’t work. .Brightness stays at 2 no matter what.
In case if you didn’t get it; I’m trying to make the .Brightness stay at 0.2 for a few seconds, then turn back to 2 (so it basically acts like there’s a voltage drop). Your script seems like it makes sense a little bit, but still won’t work properly.
AFAIK they behave and perform identically, but coroutine.wrap returns a coroutine which you need to run (hence the “()” at the end of coroutine.wrap example I gave) while task.spawn runs it instantly. I haven’t heard of any performance benefits, the only real difference is the ().