I’m trying to add in a concommand that will return a players ammo for the weapon they are holding, back into their inventory.
function GetCurWepTotalAmmo( ply ) actwep = ply:GetActiveWeapon() if ( ! actwep ) then return -1 end return ply:GetAmmoCount(actwep:GetPrimaryAmmoType()) end concommand.Add( "giveammoback", function() GetAmmoForCurrentWeapon() end)
Clearly I aint no genius at this, as I am still learning how to do a few things here and there. I used the code from Here and just used is as it was, but I got the same error i’m having the issue with but instead it was pointing to “LocalPlayer” So I removed that, and changed MySelf to ply (thinking it would work… Obviously not) If you know why its not working, or have a few pointers that could help me out, that’d be great. Anything helps.