• Mayor Job Code
    9 replies, posted
Hello! I need some help with my mayor Job Code. I simply want to add code to my current job code that ULX Gods the mayor on spawn and after 600 seconds its ungodded. I do use uTime if you need to call the time through that or just it through job code! Thanks! TEAM_MAYOR = DarkRP.createJob("Mayor", {     color = Color(0, 0, 0, 0),     model = "models/player/breen.mdl",     description = [[The Mayor of the city creates laws to govern the city.     If you are the mayor you may create and accept warrants.     Type /wanted <name>  to warrant a player.     Type /jailpos to set the Jail Position.     Type /lockdown initiate a lockdown of the city.     Everyone must be inside during a lockdown.     The cops patrol the area.     /unlockdown to end a lockdown]],     weapons = {"arrest_stick", "unarrest_stick", "stunstick", "weapon_medkit", },     command = "mayor",     max = 1,     salary = GAMEMODE.Config.normalsalary * 1.89,     admin = 0,     vote = true,     hasLicense = true,     mayor = true,     category = "Civil Protection",     PlayerDeath = function(ply)         if ply:Team() == TEAM_MAYOR then             ply:changeTeam( TEAM_CITIZEN, true )             for k, v in pairs( player.GetAll() ) do                 DarkRP.notify(v, 1, 4, "The Mayor has been killed!")             end         end     end, })
PlayerSpawn = function(ply) ply:GodEnable() end, timer.Simple( 600, ply:GodDisable() ) end,
Thank you so much. Really appreciate the help.
Ok ill try this Thanks in advance!
Yeah thanks for that I just realized I hadn't defined player and came back to correct it, thanks @diff360
I havent tested it but if the mayor goes into god and player switches job does god stick?
I have it set to respawn you at spawn after every job change, is that what you meant?
Sorry, you need to Log In to post a reply to this thread.