How to get informations from entity in cl_init.lua?

Hello,

In my cl_init.lua, I’m trying to get a network var value.



cl_init.lua
--

net.Receive( "OpenNP", function( len, ply )

  local frame = vgui.Create("DFrame")
    frame:SetSize(520,420)
    frame:SetTitle(self:GetNPTitle())
    frame:Center()
    frame:SetVisible(true)
    frame:MakePopup()
  end )




shared.lua
--

function ENT:SetupDataTables()

  self:NetworkVar( "String", 0, "NPTitle" );

end


When “self:GetNPTitle()” is in the ENT:Draw() function, all works fine, but in a net.receive function, I get this error :


attempt to index global 'self' (a nil value)

My question is, how to define the entity when not in a “ENT:” function?

(btw sorry for my poor grammar, english isn’t my native language)