I'm currently making a jail cell which has a button outside the door. Once someone is placed inside the cell, you press the button to make a brick above the door turn green/red depending on whether the cell is occupied or not.
This is the script I have so far:
local button = script.Parent local light = game.Workspace.light button.ClickDetector.MouseClick:Connect(function(occupied) light.PointLight.Color = Color3.new(255,0,0) light.Color = Color3.new(196,40,28) end) button.ClickDetector.MouseClick:Connect(function(vacant) light.PointLight.Color = Color3.new(0,255,0) light.Color = Color3.new(75,151,75) end)
So far the script somewhat works. When I click the button, it changes the pointlight colour to red, but the actual brick colour is changed to 60, 216, 228 - Teal. I don't understand why it is changing it to that colour. If I click the button again, nothing happens, but I would like it to change back to green.