over the last view days i have been scripting a gamemode for Garry’s Mod 13 and im Nearly 300% that the error the console is pointing to is Correct and there is a gmod Script Read Error Instead i will post the error and the script below
AMMO! [ERROR] gamemodes/team ruca deathmatch/gamemode/shared.lua:41: attempt to call method 'GiveAmmo' (a nil value) 1. unknown - gamemodes/team ruca deathmatch/gamemode/shared.lua:41 Timer Failed! [Reward][@gamemodes/team ruca deathmatch/gamemode/shared.lua (line 47)]
NOTE that the first line is realy the 34th*
function AmmoGive ( ply ) local ply = Entity(1) MsgN("AMMO!") if ply:Team() == 1 then ply:GiveAmmo(36,"pistol") ply:GiveAmmo(30,"AR2") elseif ply:Team() == 2 then ply:GiveAmmo(12,"357") ply:GiveAmmo(45,"SMG1") end MsgN("DONE!") end timer.Create("Reward", 30, 0, AmmoGive)]
if anyone knows why the script is wrong then please help out and reply!