Nil Value?

I have a meta table that really doesn’t want to work clientside

Here is

cl_init.lua:


function DrawBox()
draw.RoundedBox( 10, 0, 0, 100, 100, Color(0, 0, 0, 180) )
surface.SetTextColor( 200, 200, 200, 255 )
surface.SetTextPos( 100, 200 ) 
surface.DrawText( "Quest: "..LocalPlayer():Quest())
end
hook.Add("HUDPaint", "DrawBox", DrawBox);

meta.lua:


local meta = FindMetaTable("Player")

function meta:SetQuest(quest)
self:SetNWString("Quest", quest)
end


function meta:Quest()
q = self:GetNWString( "Quest" )

return q
end

Each player’s quest() is SetQuest() on each spawn… so there’s no way its nil.

And yes meta.lua is included in init.lua

I do not see an issue here…gmod comes out with this error:


[ERROR] gamemodes/medievalquestage/gamemode/cl_init.lua:393: attempt to call method 'Quest' (a nil value)
  1. fn - gamemodes/medievalquestage/gamemode/cl_init.lua:393



function meta:Quest()
return self:GetNWString( “Quest”, “”)
end

:confused: thanks … I was hoping it worked like LocalPlayer():Health() but I guess not… Logic.