#How do you make ammo not infinite?

1 messages · Page 1 of 1 (latest)

fast grove
#

I was able to make the number of rounds decrease with each shot.
And I made it so that with the number of potrons 0, the weapon could not fire.
Everything works almost well. But there is one problem, if you don't hold down the attack button, And just click on it, the attack will occur even if the number of ammo is 0.
I've been sitting with this problem since morning and I don't know how to solve it. HELP, PLEASE, GOOD PEOPLE

calm horizon
#

Aren't there like fifty tutorials for this

cedar lotus
#

Track ammo with a global variable
and if the variable reaches 0, disable the weapon component

fast grove
fast grove
calm horizon
#

You figure it out Mr Einstein

fast grove
#

💀

calm horizon
#

Is this close enough

fast grove
#

Thank you

#

Only now there is another problem

#

For now

#

I did everything exactly according to the scheme

#

I made special boxes

#

If you interact with them, you should be given ammo

#

But for some reason, an error pops up

#

I've tried everything, nothing helps