Problem with to string ! attempt to call method 'GetXp' (a nil value) (Hook,HUDPaint)

I keep getting that whatever i try to the Player XP Int to the HUD

function DrawHealthbar()

local MP = 100 

DrawBoxy( 10, ScrH()-70, 200, 60, MAIN_COLOR )
DrawRect( 20, ScrH()-60, 180, 40, MAIN_BLACKCOLOR )
DrawRect( 20, ScrH()-60, 180, 40, MAIN_GREENCOLOR )
DrawText( "XP "..tostring(LocalPlayer():GetXp()), "Trebuchet24", 110, ScrH()-40, MAIN_TEXTCOLOR, 1 ) // RIGHT HERE



How do you expect help if you don’t post the _R.Player:GetXp() function?

function meta:GetXp()
return self:GetSHVar( “Xp” )

  1. And now you haven’t posted :GetSHVar…

[editline]10th June 2011[/editline]

  1. You haven’t posted if that file is being included before or after your hud file.

[editline]10th June 2011[/editline]

  1. You did define meta, didn’t you?

2 the file is being included BEFORE my hud file

And 3 I do have define meta -.-

it only gives error if i call it from the hud if i call it from init.lua or somewhere else it just works fine

and btw GetSHVar

function EPT:GetSHVar(Name,Var)
if (!self.SHVars or self.SHVars[Name] == nil) then return Var or nil end
if (self.SHVars) then return self.SHVars[Name] end

You haven’t defined one of either GetSHVar or GetXp shared.

That was the problem it works now Thanks