Author Topic: Custom Job Help  (Read 7152 times)

0 Members and 2 Guests are viewing this topic.

Offline Merlin

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
Custom Job Help
« on: September 12, 2018, 11:07:13 AM »
So the following arguments of the PlayerSpawn function (SetWalkSpeed, SetRunSpeed & SetJumpPower) are not working for any custom job after you spawn as the job, they just revert to default.

I have no custom spawn points system/script/addon.

Here's an example of a job with the PlayerSpawn function and arguments: (Due note that the HP & Armor arguments work as intended)

Code: [Select]
TEAM_CUSTOMK1 = DarkRP.createJob("Aimbotting Hacker", {
    color = Color(196, 7, 54, 255),
    model = {"models/player/baldi/baldi.mdl"},
    description = [[The Aimbotting Hacker, very quick and nimble, but more importantly than that, THE MOST BROKEN DARKRP JOB YOU'LL EVER SEE! Given 100 starting HP, no armor, super speed and super jump power and the most OP gun you'll see, the Aimbot Assault Rifle! Running from this monster will not help you, either attempt to kill him or take the bullet to the face! This job can start Mass Terrors just like the Taliban Terrorist but he's always KOS.

This is [Owner] Merlin's Custom Psycho Killer/Terrorist Job!

You can donate for a Custom Job yourself by typing !donate and going to the website given to you.]],
    weapons = {"weapon_aimbot_ar2", "pack_sswep_prize", "pack_sswep_puppet", "pack_sswep_baldi", "pack_sswep_baldi2", "pack_sswep_filename", "pack_sswep_sweep", "pack_sswep_bully", "pack_sswep_music", "pack_sswep_playtime", "pack_sswep_principal", "pack_sswep_principal2", "pack_sswep_ruler"},
    command = "aimbotter",
    max = 1,
    salary = 0,
    admin = 0,
    vote = false,
    hasLicense = true,
    candemote = false,
    category = "Custom Jobs",
PlayerLoadout = function(ply) return true end,
PlayerSpawn = function(ply)
        ply:SetMaxHealth(100)
        ply:SetHealth(100)
ply:SetArmor(0)
        ply:SetWalkSpeed(100)
        ply:SetRunSpeed(1750)
        ply:SetJumpPower(500)
    end,
    customCheck = function(ply) return CLIENT or
        table.HasValue({"STEAM_0:0:89866500"}, ply:SteamID())
    end,
    CustomCheckFailMsg = "Merlin's Custom Job, check !donate to get yours!",
})

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given