need help with a little problem with some rules please.

guillefaceguilleface Member Posts: 1,014
hi, let says i have a actor, "bulb" on this actor i created a self integer attribute named ,"on/off" and i set it to 1
when touch is pressed change.self.on/off to (on/off+1)%2 as you know this will work as a switch button
now i have a real global attribute "#of bulbs on?"
each actor has this rule when self.on/off is true to change "#of bulbs on?"+1, otherwise -1.(so when all bulbs are on, this attribute is equal 10 because i have 10 bulbs in the scene.
what i want to do is to disable that i cant not turn off all 10 bulbs but only 9, to do this i added to the touch rule this,
when touch is pressed and "#of bulbs on?" is equal or higher than 2,
with this i can only turn off 9 and cant turn off the last bulb which is what i need, the problem is that i cant longer turn on back any of the 9 bulbs that are off.

Comments

Sign In or Register to comment.