I Have a global variable for my ammo and it is set to 10, everytime you press left mouse click it subtracts 1 from the global variable, once it reaches 0 i want it to stop me from being able to click and shoot my weapon and then the player has to wait 2.5 seconds for the gun to reload and after the 2.5 seconds are up it will reset the global variable back to 10 and then you can shoot again. Is this possible? thanks for reading
Develop games in your browser. Powerful, performant & highly capable.
Simple, use timer.
event: on mouse left click
subevent: ammo>0 and subevent: on timer "ready",
action: something spawn bullet
subtract 1 from ammo
else: set timer "ready" 2.5 sec once