Limited Ammo Question

My one ship can drop bombs but i want to know a clean method that when i have my game.bombs=0 the bombs can't spawn. I tried destroy actor but i can still see the bombs if you click fast enough.
Also is there any way i can make it so you can only drop one bomb per two seconds even if you click faster?
Thanks in advance!
Also is there any way i can make it so you can only drop one bomb per two seconds even if you click faster?
Thanks in advance!
Comments
spawn bomb.
-----
When bomb = 0
Change attribute 1 to false.
EDIT:
Didn't see the second part to the post, pretty sure it can be done more efficiently but I would have:
attribute and reset it every 2 seconds
When attribute is over 1 then don't spawn bomb.
Create an attribute called BombCount (integer) - whatever number you want
Create an attribute called BombGo (boolean) - true
In the bomb put a change attribute game.BombCount to game.BombCount + 1
Timer. For 2 Seconds, constrain BombGo to false
Timer After 2 Seconds, change attribute BombGo to true
Put in ship:
RULE
When BombGo is true, and whatever to spawn bombs (EX: when key space is down)
Spawn Actor: Bomb
RULE When game.BombCount =< 0, constrain BombGo to False
Matt
Just add the condition
when game.bombs > 0
the touch will no longer work when bombs reach 0
If you want to also only allow 1 bomb every 2 seconds make a boolean called bomballowed
And in the same rule you just added game.bombs > 0 Add a third condition game.bombsallowed is true
Add to your spawn rule a change attribute game.bombsallowed to false
Then add a new rule
When game.bombsallowed is false
--after 2 seconds run to completion checked
----Change attribute game.bombs allowed to true
So to re-cap
When touch is Pressed And
When game.bombs > 0 And
When game.bombsallowed is true
--Spawn Bomb
--Change attribute game.bombsallowed to false
When game.bombsallowed is false
--Timer, After 2 seconds Run to completion checked
------Change attribute game.bombsallowed to true
Hope that helps.
Good luck