I need a script for this (darkrp)

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


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

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


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.