Reloading a weapon

Ok so im using the text element to show my players ammunition being held. i want the number to change after everytime he fires and when he reloads to take some away from the ammo total and add to ammo in weapon. so it goes from 30/300 to 30/270 and continue to do so until it hits zero and when it hits zero it doesnt shoot anymore. If anyone knows how to manipulate it like that let me know