Author Topic: Ammo Refill  (Read 762 times)

Ok, so, how would I script a item (Airsoft Pellets Container) to work as the following:

When it is picked up, it is added to the player inventory, then, when needed to reload, the client presses a button that refills the ammo.


Thanks for the help, if you can!


Anyone?
Lol I had this working at one time.
 My method was: Check to see if the item was in my inventory, if so- check is the item's ammo variable is greater then or equal to my current weapon's max ammo, if so- subtract the max ammo from the item and add it to my current weapon, if not- make my weapon equal the item's ammo variable and set the item's variable to zero ( I made the item remove fomr the inventory if it equal 0).

For reloading, you can package serverCmdLight. You can also package shapeBase::pickup for when an item is picked up. The rest is logic, I won't help you with that.

Lol I had this working at one time.
 My method was: Check to see if the item was in my inventory, if so- check is the item's ammo variable is greater then or equal to my current weapon's max ammo, if so- subtract the max ammo from the item and add it to my current weapon, if not- make my weapon equal the item's ammo variable and set the item's variable to zero ( I made the item remove fomr the inventory if it equal 0).

Thanks. Not sure if it helped or not, being that I haven't done a lot of scripting in my lifetime. Lol I actually wanted to base some guns like yours with the airsoft pellets and stuff like that.

Thanks. Not sure if it helped or not, being that I haven't done a lot of scripting in my lifetime. Lol I actually wanted to base some guns like yours with the airsoft pellets and stuff like that.

Well, maybe we can work together on this project

Well, maybe we can work together on this project
Thanks, that would be great! One problem is, i use Milkshape 3D to model. I haveblender but i need to figure out how to use it.... :/