DarkRP How to make a class die upon death?

How do people do this, I see it done often, and it seems simple, but I cant figure it out… Any help is much appreciated!

(User was banned for this post ("Missed the darkrp help thread" - postal))

Make a class die upon death? Die upon death… what does that even mean?

Pretty sure he means go back to spawn.

If this the case, go to config.lua, then search for GM.Config.norespawn, after you do that, set to false.


PlayerDeath eg:

[lua]PlayerDeath = function(ply, weapon, killer)
if( ply:Team() == TEAM_MAYOR ) then
ply:ChangeTeam( TEAM_CITIZEN, true )
for k,v in pairs( player.GetAll() ) do
v:PrintMessage( HUD_PRINTCENTER, “The mayor has been killed! We need a new mayor!” )