Basically i have a map that spawns in weapons and when i pickup those weapons they have no ammo in them so yh...
Ill have to brb ill reply to anything when i come back
[editline]19th December 2015[/editline]
Back
What map and gamemode are you running?
I just need to give them ammo when they pickup a weapon in lua
Not sure if i can bump but really need to fix this...
Doesn't work any other solution
[code]
[ERROR] lua/tet.lua:3: attempt to index local 'wep' (a nil value)
1. fn - lua/tet.lua:3
2. unknown - addons/ulib/lua/ulib/shared/hook.lua:179
[/code]
[QUOTE=skatehawk11;49353551]What is in your tet.lua file? Also I would call it in the WeaponEquip hook.[/QUOTE]
Yeah i did that
my tet.lua is just
function GetAmmoForCurrentWeapon( ply )
if ( !IsValid( ply ) ) then return end
local wep = ply:GetActiveWeapon()
if ( !IsValid( wep ) ) then return end
return ply:GiveAmmo( 100, wep:GetPrimaryAmmoType(), false )
end
hook.Add("WeaponEquip", "Grabbin.Peelz", GetAmmoForCurrentWeapon )
Sorry, you need to Log In to post a reply to this thread.