Attempt to call method "x" ( a nil value) occurs inside hook

So, whenever I try to call any function (apart from one I made) inside a GM:PlayerDeath hook it always throws up the “Attempt to call method” error.
[lua]function GM:PlayerDeath( victim, killer, info )

if ( !victim:IsPlayer()  ) then return end

victim:SetData( "prevspawn", CurTime() )
killer:SetData( "kills", killer:Info( "kills" ) +1 )

if info:GetInflictor():GetClass() == "gg_knife" then

	Announce( victim:Nick().." was humiliated by "..killer:Nick().."!" )
	victim:SetData( "level", victim:Info( "level" ) > 0 and victim:Info( "level" ) -1 or 0  )
	killer:SetData( "knife", killer:Info( "knife" ) +1 )

end

end[/lua]
The error always occurs with “Info”, I tried putting killer:SteamID(), that throws up an error.
I ran all of these functions in-game with lua_run and they’re fine.

Just so you know, I think my computer hates Lua.

PlayerDeath’s arguments are victim, info, killer. You’re getting thrown errors because in this code, killer is actually damage information and info is the attacking entity.

You’re using PlayerDeath with DoPlayerDeath’s parameters

e: darn, ninja’d

Oh my god I was returning if the victim was a player, not the killer. Goddamnit, thanks anyways fellas.

[editline]13th October 2013[/editline]

Also, I forgot to mention that I changed it to GM:PlayerDeath for some reason. I intended to use GM:DoPlayerDeath.