1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

How to make a job change after death?

Discussion in 'DarkRP Modding Questions & Help' started by Звездочка Butterfly, Oct 3, 2019.

  1. I want to make so that at the time of death for the work of "Mayor" you become a "Citizen"
     
  2. # VALERY

    # VALERY Member

  3. [DarkRP] addons/darkrpmodification/lua/darkrp_customthings/jobs.lua:438: unexpected symbol near ','
    1. loadCustomDarkRPItems - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:138
    2. Call - gamemodes/darkrp/gamemode/libraries/modificationloader.lua:149
    3. unknown - gamemodes/darkrp/gamemode/cl_init.lua:56

    -- Mayor
    TEAM_MAYOR = DarkRP.createJob("Mayor", {
    color = Color(255, 0, 0, 255),
    model = {"models/player/breen.mdl"},
    description = [[Hehe]],
    weapons = {"m9k_fists", "stunstick"},
    command = "mayor",
    max = 1,
    salary = 650,
    admin = 0,
    vote = true,
    hasLicense = true,
    candemote = true,
    -- CustomCheck
    medic = false,
    chief = false,
    mayor = true,
    hobo = false,
    cook = false,
    category = "Government",
    PlayerDeath = function(ply, weapon, killer)
    ply:teamBan()
    ply:changeTeam(GAMEMODE.DefaultTeam, true)
    if killer:IsPlayer() then
    DarkRP.notifyAll(0, 4, "The mayor has been killed and is therefor demoted.")
    else
    DarkRP.notifyAll(0, 4, "The mayor has died and is therefor demoted.")
    end,
    })
     
  4. ella

    ella New Member

    Simplerr should really help with issues like this. You're getting a Lua error as you put a comma in on accident. Remove the comma after "end", everything should be fixed for you.
     
  5. # VALERY

    # VALERY Member

    There is only one "end" when you have 2 functions.
     

Share This Page