I made a part in this location game.Workspace
I called it TheSwitch and added a few other objects including a ClickDetector and a decal
When you click it, it's supposed to change the value of a number value which would get involved in a later script that isn't in this question, the image, and the brick color. It's not working because there's a supposed error in the first line in the start of the if statement claiming that = should be replaced with then but I don't know what to replace .Value = '1' with.
The Script
local function onMouseClick(player)
if game.Workspace.Value.Value then
game.Workspace.Value.Value = 0
game.Workspace.TheSwitch.Decal.Texture = 'rbxgameasset//images/CoolingTemp'
game.Workspace.Value.Value = 1
game.Workspace.TheSwitch.BrickColor = 'Lime Green'
else
game.Workspace.TheSwitch.Decal.Texture = 'rbxgameasset//images/AtomTechHeatError'
game.Workspace.Value.Value = 0
game.Workspace.TheSwitch.BrickColor = 'Really Red'
end
end
clickDetector.MouseClick:connect(onMouseClick)

1 comment
if game.Workspace.Value.Value == '0' then