Greeting! I made a script that should change the color of the object every two seconds. The problem is it doesn’t work, please help if you can see what the problem is.
**What do you want to achieve? I want to make objects turning their color every 2 seconds.
**What is the issue? It dosent work, but scripts are fine.
**What solutions have you tried so far? I searched it on internet, but nothing.
I see you want it changing every 2 seconds, but you only have it set to change twice. You will need to put them in some kind of loop if you want it changing every 2 seconds.
You could add a while true do and then you have some kind of identifier to know its either red or green.
Try naming a variable called red and make the value of it be true so inside the while loop you add this:
if red == true then
-- If the part is going to be red then
Part.Color = Color.fromRGB(255,0,0)
red = false
elseif red == false then
Part.Color = Color.fromRGB(0,255,0)
red = true
end
This will loop and make the part become red or green depinding of the red variable. So later this identifier’s end you put a wait(2) for the cooldown.