• Get Job Health
    2 replies, posted
hello, I would like to know to get a job health In DarkRP. :GetMaxHealth() returns the health by default of player in the gamemodeconfig (100, by default) but I'm talking about getting health from a job where is PlayerSpawn = function(ply) ply:SetHealth(200) end,
ply:GetHealth() would only retrieve the current health value, you should set their default health then for the job..
This should probably be in the Developer Discussion category. Are you referring to where you'd put the PlayerSpawn call in the job file? You just add the function as another line in that job's config. Should look something like this (using the default Citizen job file): [CODE]TEAM_CITIZEN = DarkRP.createJob("Citizen", { color = Color(20, 150, 20, 255), model = { "models/player/Group01/Female_01.mdl", "models/player/Group01/Female_02.mdl", "models/player/Group01/Female_03.mdl", "models/player/Group01/Female_04.mdl", "models/player/Group01/Female_06.mdl", "models/player/group01/male_01.mdl", "models/player/Group01/Male_02.mdl", "models/player/Group01/male_03.mdl", "models/player/Group01/Male_04.mdl", "models/player/Group01/Male_05.mdl", "models/player/Group01/Male_06.mdl", "models/player/Group01/Male_07.mdl", "models/player/Group01/Male_08.mdl", "models/player/Group01/Male_09.mdl" }, description = [[The Citizen is the most basic level of society you can hold besides being a hobo. You have no specific role in city life.]], weapons = {}, command = "citizen", max = 0, salary = GAMEMODE.Config.normalsalary, admin = 0, vote = false, hasLicense = false, candemote = false, category = "Citizens", PlayerSpawn = function(ply) ply:SetHealth(100) end, --Comma is only needed if there is more code left to be run in this job })[/CODE]
Sorry, you need to Log In to post a reply to this thread.