I will change the color of a button when a door or portcullis is open or closed. Therefor I have made two models. One with green button and one with a red button.
I wrote the following script to the "red button", which is primarily there.
Code: Select all
function buttondrop()
if khorne_door_portcullis_6:isOpen() then
spawn("khorne_button_green", 2, 2, 19, 1)
else
spawn("khorne_button_red", 2, 2, 19, 1)
end
end
All what happens now is that by opening the portcullis the red button changed into a green button. But by activating again the portcullis will be closed and the color remains green.