[Lua] Darkrp Vars Startup Error

Am made a Hud for darkrp and am getting this error every time i load in



[ERROR] addons/darkrpmodification/lua/darkrp_modules/wolfhud/cl_hud.lua:42: attempt to index field 'DarkRPVars' (a nil value)
  1. fn - addons/darkrpmodification/lua/darkrp_modules/wolfhud/cl_hud.lua:42
   2. unknown - addons/ulib/lua/ulib/shared/hook.lua:109


Hud Code


local ply = LocalPlayer
local health = LocalPlayer():Health()
local armor =	LocalPlayer():Armor() 
local job = LocalPlayer().DarkRPVars.job
local money = LocalPlayer().DarkRPVars.money
local salary = LocalPlayer().DarkRPVars.salary

--[[---------------------------------------------------------
	Name: Players Name
-----------------------------------------------------------]]
	draw.SimpleText("Name: " ..LocalPlayer():Nick(), "Font", 30, ScrH() - ScrH() + 30,Color(255,255,255, 255),0, 1)
--[[---------------------------------------------------------
	Name: Players Money
-----------------------------------------------------------]]
if money == nil then
	draw.SimpleText("Wallet: ".."Uknown Amount","Font", 100,ScrH() - ScrH() + 60, Color(255,255,255,255), 0, 1)
else
	draw.SimpleText("Wallet: ".. "£" ..money , "Font", 30, ScrH() - ScrH() + 60,Color(255,255,255, 255),0, 1)
end
--[[---------------------------------------------------------
	Name: Players Salary
-----------------------------------------------------------]]
if salary == nil then
	draw.SimpleText("Salary: ".."Uknown salary","Font", 100,ScrH() - ScrH() + 90, Color(255,255,255,255), 0, 1)
else
	draw.SimpleText("Salary: ".."£ "..salary, "Font", 30, ScrH() - ScrH() + 90,Color(255,255,255, 255),0, 1)
end
--[[---------------------------------------------------------
	Name: Players Job
-----------------------------------------------------------]]
if job == nil then
	draw.SimpleText("Uknown Job","Font", 100,ScrH() - ScrH() + 120, Color(255,255,255,255), 0, 1)
else
	draw.SimpleText("Job: "..job , "Font", 30, ScrH() - ScrH() + 120,Color(255,255,255, 255),0, 1)
end

Thanks!

You’re using the vars wrong? It’s


 getDarkRPVar("money") 

that would show player money.
Reference: http://forum.darkrp.com/threads/list-of-darkrp-vars.4193/

How would i put that into the hud i have made?



local money = LocalPlayer():getDarkRPVar("money")


This will work


draw.SimpleText("Wallet: ".. "£" ..LocalPlayer():getDarkRPVar("money"), "Font", 30, ScrH() - ScrH() + 60,Color(255,255,255, 255),0, 1)

That would make your wallet show players darkrp money.