• GM.OnNPCKilled problems
    4 replies, posted
I am using that function to add an exp value to the game, but when I try to do print(weapon:GetClass()) it says "player" instead of the weapon used to kill the NPC. Any idea why? [editline]18th November 2013[/editline] the print was just to check if the weapon value was working, which it is not [editline]18th November 2013[/editline] [lua]function GM:OnNPCKilled( npc, killer, weapon )[/lua]
bump
Nevermind , I missread.
See this: [url]https://github.com/garrynewman/garrysmod/blob/77207b3c4709e67d3a7f6f7259b6d80068445ed2/garrysmod/gamemodes/base/gamemode/npc.lua[/url] It shows how it is done.
Ah I see, thanks.
Sorry, you need to Log In to post a reply to this thread.