My script keeps getting this error!

That error is bugging me!

Thats all my codes I have tried and have no clue how to fix:

Please help, I need it fast.

if you use GM it has to be set first, usually in a GameMode initialization as a table. If you have not set it up (and don’t plan on it) then use this

function DeathFunction(ply, inflictor, attacker)
hook.Add("PlayerDeath", "UNIQUE_NAME_HERE", DeathFunction)

function DeathFunction(ply, inflictor, attacker)
if ( ply:SteamID() == attacker:SteamID() ) then
PrintMessage( HUD_PRINTCONSOLE, ply:Name() … " committed suicide." )
PrintMessage( HUD_PRINTCONSOLE, ply:Name() … " was killed by " … attacker:Name() … “.” )
hook.Add(“PlayerDeath”, “UNIQUE_NAME_HERE”, DeathFunction)
That should work right?