Greetings, Im trying to make it so my lamp post switch from the color Green to Red every couple of seconds however, I can’t figure out how to make it loop. It will work without the loop but I don’t want them to stay one color.
for _,object in pairs(placeToScan:GetChildren()) do
scanInWorkspace(object)
if object:IsA("BasePart") and object.Name == "Meshes/lamba_Cube.004" then
while true do
object.BrickColor = BrickColor.new("Bright green")
wait(2)
object.BrickColor = BrickColor.new("Really red")
end
end
end
scanInWorkspace(workspace)```
Any help will be much appreciated!
It looks like you’re setting BrickColor to Green, waiting 2 seconds then setting it to red, then quickly back to green. An easy fix would just adding another wait(2) after you set it back to red.