Custom Job HP, SPEED, ARMOR problem

Hi, when I become the class I have 255 hp, 255 armor, and speed.

However, when I die and respawn I lose my HP as it gets set back to 100 and my speed is gone.

In order for me to get it back I have to choose another job then go back to that job.


TEAM_PYS = DarkRP.createJob("PYS", { -- Name
    color = Color(0, 0, 200, 255), -- Team color
    model = "models/player/edward_kenway.mdl", -- Player model
    description = [[Fun Class!]],  -- Job description
    weapons = {"m9k_damascus"}, -- Additional weapons
    command = "pys", -- Command to become the job
    max = 1, -- Maximum amount of said job
    salary = 45, -- Salary
    admin = 1, -- Requires Admin? 1 for yes, 0 for no.
    vote = false, -- Do they need to vote? true for yes, false for no.
    hasLicense = false, -- Has a license
    customCheck = function(ply) return ply:GetNWString("usergroup") == "Owner" end, -- The extra check function. Enter nil or nothing to not have a restriction
    PlayerLoadout = function(ply)

        ply:SetHealth(255)
        ply:SetArmor(255)
        ply:SetRunSpeed(ply:GetRunSpeed() * 3)
        ply:SetWalkSpeed(ply:GetWalkSpeed() * 2)
        ply:SetCrouchedWalkSpeed(ply:GetCrouchedWalkSpeed() * 2)
end
})


You should use “PlayerSpawn”, instead of loadout

I Have tried PlayerSpawn…

The problem with PlayerSpawn is when I become the class I don’t have the 255 health, armor, or speed.

In order for me to get all that stuff when I use PlayerSpawn I have to kill myself or get killed then I’ll have it.

Do both then. It’s messy but it will probably work.


    PlayerLoadout = function(ply)

        ply:SetHealth(255)
        ply:SetArmor(255)
        ply:SetRunSpeed(ply:GetRunSpeed() * 3)
        ply:SetWalkSpeed(ply:GetWalkSpeed() * 2)
        ply:SetCrouchedWalkSpeed(ply:GetCrouchedWalkSpeed() * 2)
end
    PlayerSpawn = function(ply)

        ply:SetHealth(255)
        ply:SetArmor(255)
        ply:SetRunSpeed(ply:GetRunSpeed() * 3)
        ply:SetWalkSpeed(ply:GetWalkSpeed() * 2)
        ply:SetCrouchedWalkSpeed(ply:GetCrouchedWalkSpeed() * 2)
end


Thanks! This fixed the problem I was having :slight_smile: