Implement player ammo limit

How to Implement a player ammo limit and counter in the form of a reusable component.

Add the ability to throw weapons away.

This is my assignment for the course and I don’t know how to start with it all.

I’m looking on YouTube. I’m asking Chat GPT and they don’t give me the obvious answer.
I just need step-by-step instructions to do it all. Maybe there’s a thread about it somewhere.

ammo limit? make a integer and when player fires make this integer -1. in fire function, if ammo is less then 1, don’t fire.