for i,v in pairs(light:GetChildren()) do local start = v.MainLight.Color local End = selcolor for i = 0,1,.1 do wait() local color = start:lerp(End,i) v.BrickColor = BrickColor.new(color) v.Color = color end end
That's my code and it works but I want all the parts to change colour at the same time, not one after the other.
https://gyazo.com/40be1e6c8d5c7225cb90039d32c8a2cb
I don't want to union them since my system to change the colours allows you to change each individual part's colour or all of them at once.
A for i
loop will stop any code from running below it until it is finished reaching it's goal. To stop this, place the loop inside a spawn function:
for i,v in pairs(light:GetChildren()) do local start = v.MainLight.Color local End = selcolor spawn(function() for i = 0,1,.1 do wait() local color = start:lerp(End,i) v.BrickColor = BrickColor.new(color) v.Color = color end end) end