• Custom Job HP, SPEED, ARMOR problem
    4 replies, posted
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. [CODE]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 }) [/CODE]
You should use "PlayerSpawn", instead of loadout
[QUOTE=Insane21M;47325720]You should use "PlayerSpawn", instead of loadout[/QUOTE] 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.
[QUOTE=cseal69;47325729]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.[/QUOTE] Do both then. It's messy but it will probably work. [code] 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 [/code]
[QUOTE=Insane21M;47325740]Do both then. It's messy but it will probably work. [code] 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 [/code][/QUOTE] Thanks! This fixed the problem I was having :)
Sorry, you need to Log In to post a reply to this thread.