I currently have this code to demote the mayor upon death, but I have no idea where to place it.
function MayorDemote( victim, weapon, killer )
if victim:Team() == TEAM_MAYOR then
victim:ChangeTeam(TEAM_CITIZEN, true)
victim:ChatPrint("You died and are now a regular citizen.")
killer:AddMoney(1000)
for k, v in pairs (player.GetAll()) do
if v != victim then
v:PrintMessage( HUD_PRINTCENTER, "The mayor has died!" )
end
end
end
end
hook.Add( "PlayerDeath", "mayorDemote", MayorDemote )