FPS pickup script help

I have attempted to modify the pickup script from the fps tutorial to include ammo. As a scripting newbie I’m pretty confused. Everything seems to work except actually adding ammo to the player’s total, a pretty important part, lol. I would appreciate any insight that anyone has to offer on the problem. :slight_smile:
Thanks

252213--9076--$ammo_pickup_settings_788.jpg
252213--9077--$pickup_script_513.jpg

I don’t know how the rest of your code is wired, but are you sure you want to update the bulletsPerClip variable? I’d guess you might want the “bulletsLeft” var instead…

That, and you need to make sure you’re even getting inside the new “else if” block. That is, does pickupType actually equal PickupType.Ammo?

Jeff

Thanks for taking the time to reply jgodfrey. I tried to change the line to read “bulletsLeft” and got an error message unavailable due to its protection level, so I went into the machineGun script, and changed bulletsLeft from a private variable to a public one, and now my ammo pickup works! :smile:
Thanks for the help. 8)

how? can u show me ur new script plz