Bool issue

Started by DrewCCU, Sat 17/04/2010 20:57:40

Previous topic - Next topic

DrewCCU

Okay ... i dont know exactly how i need to set this code up or exactly where (room or global) - i've tried a couple different things but can't get anything that doesn't give me an error. Maybe you guys could help me out real quick and tell me what i need to do. here is what i need.

I have a bool - when it is set to false and you click on certain buttons within gui menus then i need certain stuff to happen. 

So ...

If (!bool) {
    press this gui button and you get this result.
}

the bool will be turned on/off by switch in the game the player can flip on and off again anytime they want. so i assume i would also need something thats constantly checking if that bool is on or off?
"So much of what we do is ephemeral and quickly forgotten, even by ourselves, so it's gratifying to have something you have done linger in people's memories."
-John Williams

Gilbert

You shouldn't need to do the checking constantly, just declare that boolean variable as global and check it in the GUIs buttons' script.

DrewCCU

wow. i feel like an idiot. that was much simpler than i was trying to make it. lol. thanks!
"So much of what we do is ephemeral and quickly forgotten, even by ourselves, so it's gratifying to have something you have done linger in people's memories."
-John Williams

SMF spam blocked by CleanTalk