Button that changes color on click

So im trying to make a button that when clicked turns green and makes a door disappear. But i also want that when clicked again, it turns red and makes the door appear again, as if it was a toggle basically. I’ve looked up some posts in the forums and videos on YT and tried mimic what they did since my original attempts weren’t working but to no luck, it still doesn’t work even though it looks simple…so im lost and now come for help :confused:

This is my current script, already deleted the part that wasn’t working. So far, it has the part that turns it green/open status and disappear the door model working properly. Any help is appreciated. Thanks for your time.

local door = script.Parent.Parent.DoorBarricade1
local descendants = door:GetDescendants() 
local button = script.Parent

local ClickDetector = workspace.Objectives.ButtonDoor.Button.ClickDetector

local activated = false
		
ClickDetector.MouseClick:Connect(function()
	if activated == false then
	button.BrickColor = script.Parent.ButtonOpen.Value 
	workspace.Objectives.ButtonDoor.Button:FindFirstChild("button"):Play()
	workspace.Objectives.ButtonDoor.Button:FindFirstChild("Door Close"):Play()
	for i=1,#descendants do
		local descendant = descendants[i]
		if descendant:IsA("BasePart") then
				descendant.Transparency = 1
				descendant.CanCollide = false
				activated = true
					end
				end
			end
end)

Instead of
button.BrickColor = script.Parent.ButtonOpen.Value
use the BrickColor itself (whatever colours you choose) and then check to see what the colour is for open and close
if button.BrickColor == "Bright red" then button.Brickcolor = "Bright green"
code for opening door
else button.BrickColor = "Bright red"
code for closing door
end

If script.Parent.ButtonOpen.Value is a Color3 Value then, you can try using:
BrickColor.new(script.Parent.ButtonOpen.Value)

maybe try

script.Parent.ClickDetector.MouseClick:Connect(function()
    local bool = script.BoolValue.Value
    script.BoolValue.Value = not bool 
    brickColorTable = {[false] = BrickColor.Green(),[true] = BrickColor.Green()}
    --script.Parent.CanCollide = bool
    script.Parent.BrickColor = brickColorTable [bool]
end)