Need help setting health for certain jobs

Hi I’m rather new to being a server owner for a Star Wars RP, and I have one question because it literally has me beat. I have everything done on my server, all the jobs, spawns, groups, weapons, addons, etc. The one thing I cannot manage to figure out is where to put this function “PlayerSpawn = function(ply) ply:SetHealth(5000) ply:SetMaxHealth(5000) end,” I can only do one of these functions. if I do SetHealth, the health is there but when you get injured it lowers and basically makes it so you cant heal back up to Its original value. If I do SetMaxHealth, I start off with 100 like normal and can heal up to the max health. Neither of those I want. Here is an example of one of the jobs (Apologies on the sloppiness but I used a template to help me know what changes what.)

TEAM_VADER = DarkRP.createJob(“Sith Lord”, { – Name
color = Color(0, 0, 0, 255), – Team color
model = “models/nate159/swbf/hero/player/hero_sith_vader_player.mdl”, – Player model
description = [[You are Darth Vader, once Anakin Skywalker the
chosen one. Easily one of the most intimidating
sith, you follow the orders of the emperor.]], – Job description
weapons = {“weapon_lightsaber”, “forcechoke”}, – Additional weapons
command = “vader”, – Command to become the job
max = 1, – Maximum amount of said job
salary = 0, – Salary
admin = 0, – 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
category = “Sith”,
sortOrder = 14,
customCheck = function(ply) return ply:GetUserGroup() == “vader” or ply:IsAdmin() end, – The extra check function. Enter nil or nothing to not have a restriction
CustomCheckFailMsg = “You must become Darth Vader to be this job”
})

Healing comes through what ?



TEAM_VADER = DarkRP.createJob("Sith Lord", { -- Name
	color = Color(0, 0, 0, 255), -- Team color
	model = "models/nate159/swbf/hero/player/hero_sith_vader_player.mdl", -- Player model
	description = [[You are Darth Vader, once Anakin Skywalker the
	chosen one. Easily one of the most intimidating
	sith, you follow the orders of the emperor.]], -- Job description
	weapons = {"weapon_lightsaber", "forcechoke"}, -- Additional weapons
	command = "vader", -- Command to become the job
	max = 1, -- Maximum amount of said job
	salary = 0, -- Salary
	admin = 0, -- 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
	category = "Sith",
	sortOrder = 14,
	customCheck = function(ply) return ply:GetUserGroup() == "vader" or ply:IsAdmin() end, -- The extra check function. Enter nil or nothing to not have a restriction
	PlayerSpawn = function(ply) ply:SetHealth(5000) ply:SetMaxHealth(5000) end,
	CustomCheckFailMsg = "You must become Darth Vader to be this job" 
})


Whatever you did, worked, and I appreciate you very much good sir. Sorry if it was a dumb question.

[editline]31st December 2016[/editline]

I apologize. Im stuck again… I put that in each one of my jobs, but i realized i put “PlayerSpawn.” I need to use PlayerLoadout so that they don’t have to die to recieve the health next spawn. I want them to just be able to select the job and have the health. Anyways, this is what each of my jobs currently look like.

TEAM_VADER = DarkRP.createJob(“Sith Lord”, { – Name
color = Color(0, 0, 0, 255), – Team color
model = “models/nate159/swbf/hero/player/hero_sith_vader_player.mdl”, – Player model
description = [[You are Darth Vader, once Anakin Skywalker the
chosen one. Easily one of the most intimidating
sith, you follow the orders of the emperor.]], – Job description
weapons = {“weapon_lightsaber”, “forcechoke”}, – Additional weapons
command = “vader”, – Command to become the job
max = 1, – Maximum amount of said job
salary = 0, – Salary
admin = 0, – 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
category = “Sith”,
sortOrder = 14,
customCheck = function(ply) return ply:GetUserGroup() == “vader” or ply:IsAdmin() end,
PlayerLoadout = function(ply) ply:SetHealth(5000) ply:SetMaxHealth(5000) end,
CustomCheckFailMsg = “You must become Darth Vader to be this job”
})

I continue to get script errors however, all of them are exactly the same

Can you post the script error?

Use this:

Should help make the job without errors! Give it a try

EDIT:

Try changing


 CustomCheckFailMsg = "You must become Darth Vader to be this job" 

to


 CustomCheckFailMsg = "You must become Darth Vader to be this job", 

The key is at the end of the table; putting a comma makes no difference. Also, there’s no need to use a tool when the job is already created.