S
Salsa
Guest
hello
I have been trying to get a reloading mechanic in my game for a little bit. right now i have it so whenever you press R you ammo will reload to the maximum you can get after about 2 seconds.
I wanted to add a spot where whenever your ammo reaches zero it will automatically reload, but for some reason this part of it is just not working. Here is the code, im wondering if someone can tell me why it is not working, or even a better way to do all of this.
thanks!
I have been trying to get a reloading mechanic in my game for a little bit. right now i have it so whenever you press R you ammo will reload to the maximum you can get after about 2 seconds.
I wanted to add a spot where whenever your ammo reaches zero it will automatically reload, but for some reason this part of it is just not working. Here is the code, im wondering if someone can tell me why it is not working, or even a better way to do all of this.
thanks!
GML:
[ Both alarm events just have the same thing in it which is Sammo = 8; ]
if (keyboard_check_pressed(ord("R")))
{
alarm[1] = 60;
}
if (Sammo <= 0)
{
alarm[0] = 60;
}