DarkRP Mayor Doesn't Demote Upon Death.

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 )

Send me your steam and I will help you.

Considering your username is getbootedkid, I think I’ll have to pass.
I’d like to keep any help/suggestions on site if possible.

atleast someone knows what usernames are suspicious and worst he joined pretty soon before posting that.

I still need help.

Can someone please tell me where to place this code?

If someone could tell me where to place this code that would be great.

yea im also having problems with this please help :smile: