Weapon wont use ammo?!

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

FireSlash

Whats a FireSlash?
Feb 3, 2001
4,300
0
0
39
Central Ohio
www.unrealannihilation.com
when i spawn this, it has 9999 ammo. it wont use any of that 9999 ammo. if i manually set it to 0 ammo, it will not fire, but if i pick up new ammo, it does not add the value to the status bar, or fire.

maybe i missed somthing... heres the code.
Code:
{fixed}
 
Last edited:

EasyRaider

Crazy coder
Sep 21, 2001
74
0
0
43
Norway
1) I think you should use
AmmoType.UseAmmo (1);
instead of
ammotype.ammoamount--;
but AFAIK both should work.

2) Don't try to set AmmoType in DefaultProperties. AmmoType references an ammo object, not a class.

3) Try to add
if (AmmoType == None)
GiveAmmo(Pawn(Owner));

before
if (ammotype.ammoamount > 0) {