Whats wrong with my code? :C

I am trying to get this script to add XP to a players level everytime they kill a npc.
[LUA]hook.Add(“OnNPCKilled”, “AddXP”, function()
Does this look right? I am using this leveling system http://steamcommunity.com/sharedfiles/filedetails/?id=222631611

[editline]24th March 2014[/editline]

You’re missing the arguments for the hook.

You’re gonna want to check if the killer is a player, and then add the xp.

You need the function to pass the arguments supplied by the hook, it should be function( npc, ply, attacker )
AddXP is not a player function, simply use AddXP( ply, 15 )
Make sure you are doing this on server-side.

[editline]24th March 2014[/editline]

Yes, also add a “if not ply:IsValid() then return end” on the first line of your function. It’s always good practice.