local value = 0
if value == 0 then
value = value + 1
Target.BrickColor = BrickColor.new("Black")
end
if value == 1 then
value = value + 1
Target.BrickColor = BrickColor.new("White")
end
if value == 2 then
value = value -2
Target.BrickColor = BrickColor.new("Mid gray")
end
I'm doing a building game but this doesn't work as intended. When a player clicks "Target", it checks if value is 0 and if so, it adds 1. If the player clicks "target" again it checks if value is1 and changes color and adds 1. Finally, when "target" is clicked, it checks for the value to be 2 and changes color and resets back to 0 by subtracting 2. Then when the player clicks "target" again the cycle repeats. I tested this and when I click "target" the color changes to white instead of what's supposed to be black. If I click it again nothing happens. Please help me.

5 comments
Is this the exact code in the script, because if it is the indenting might be the problem but idk.
It's not the exact code. It's a shortened up version, but this is the important stuff.
Is the indenting the same?
Yes of course.
Any errors?