local s1 = script.Parent.Spawn1 local s2 = script.Parent.Spawns2:GetChildren() local loop = coroutine.create(function() while true do wait(.4) s1.BrickColor = BrickColor.Random() end end) coroutine.resume(loop) wait(.4) local loop2 = coroutine.create(function() while true do wait(.4) for i,v in pairs(s2) do v.BrickColor = s1.BrickColor end end end) coroutine.resume(loop2)
The second set of spawns are meant to wait .4 seconds before they change but they change right when the first spawn changes. Why?
local loop2 = coroutine.create(function() while true do for i,v in pairs(s2) do wait(0.4) v.BrickColor = s1.BrickColor end wait() -- make sure that the loop doesn't crash the script end end)