Text box needs to be every tick to update the value of the global variable constantly. On created just shows the global var value at the start of layout when text box is created. The ammo value was always correct though, I checked in debug mode.
The problem with the guns appears to be that the bullets are firing every tick so fast that when they are fired, ammo is less than 0 in that tick before fixed by event 79, so the ammo=0 (event 80) isn't true at the point the bullet is created. What is happening is that ammo is always less than 0 whenever a bullet is fired on those guns. Change event 80 to less than or equal to 0 and it's fixed.