I need a script for this (darkrp)

Can you make a script to when the mayor dies or switches jobs, the laws will reset.

[lua]

hook.Add(“PlayerDeath”, “ClearLaws”, function( ply ) – Init.lua
if ply:Team() == TEAM_MAYOR then
Laws = {}
umsg.Start(“DRP_ClearLaws”)
umsg.End()
end
end

local function ClearLaws( um ) – cl_init.lua
Laws = {}
end
usermessage.Hook(“DRP_ClearLaws”, ClearLaws )

[/lua]

not my code its from a similar thread

Alright something off-topic:
“Killerdude” only requested stuff; I thought this is an DEVELOPER section where people help each other coding stuff, and not spoonfeed stuff?

You can still learn how to code stuff through examples, but explaining how to do it would have definitely been the better way.