I know this is a bit stupid but still, How to + the ammo of someone when he already is carrying the weapon?
Tried using the player.Ammo+= but it gives error lol
Use a combination of player.GetAmmoAtSlot and player.GiveWeapon.
Let's say you want to give 100 stubby ammo.
local currentAmmo = player.GetAmmoAtSlot( 5 );
player.GiveWeapon( 21, currentAmmo + 100 );
Untested
Note there's also a function called player.GetWeaponAtSlot. So you can just give 100 ammo of whatever weapon the player is holding in a particular slot.
Will this work? player.SetWeapon(32,player.Ammo.tointeger() 1500);
Just tested it, and it worked. Locked and marked as solved.
Quote from: Xmair on Sep 25, 2015, 08:08 AMWill this work? player.SetWeapon(32,player.Ammo.tointeger() 1500);
I doubt that will work if you have another weapon current equipped. It will that ammo, not the weapon you want to increase.