[LUA Question]Trying to do a function in entity derma.

Hello, I created a derma stuff for an entity and I triying when I click in the button it does a init.lua function, does anyone know how do it? I’m stuck because when I do it the server says I doing a nil value function…

And another problem is when I use the entity it do the ENT:Use function five times.

PD.: I’m editing a DarkRP entity.

PD2.: Sorry for bad english

maybe you should show us your code

cl_init code:
[lua]local function SimpleDerma()
local DermaPanel = vgui.Create( “DFrame” )
DermaPanel:SetPos(ScrW() / 2, ScrH() /2)
DermaPanel:SetSize( 280, 125 )
DermaPanel:SetTitle( “A simple derma” )
DermaPanel:SetVisible( true )
DermaPanel:SetDraggable( true )
DermaPanel:ShowCloseButton( true )
DermaPanel:MakePopup()

local DermaLabel = vgui.Create( "DLabel" )
DermaLabel:SetParent( DermaPanel )
DermaLabel:SetColor(Color(255,255,255,255))
DermaLabel:SetFont("default")
DermaLabel:SetText("A simple label")
DermaLabel:SizeToContents()
DermaLabel:SetPos(40, 25)

local DermaButton = vgui.Create( "DButton" )
DermaButton:SetParent( DermaPanel )
DermaButton:SetText( "Button" )
DermaButton:SetPos( 40, 50 )
DermaButton:SetSize( 200, 50 )
DermaButton.DoClick = function ()
	self:DoIt();
end

end;

usermessage.Hook(“SimpleDerma”, SimpleDerma)[/lua]

init.lua code:
[lua]function ENT:Use(activator, caller)
local owner = self:Getowning_ent();
if(caller:IsPlayer() && caller == owner) then
umsg.Start(“SimpleDerma”, caller)
umsg.End()
end;
end;

function ENT:DoIt()
GAMEMODE:Notify(self:Getowning_ent(), 1, 4, “ITS WORKS!.”)
end;[/lua]

The other part of the code is from DarkRP money printer

Net library.

Thanks, it worked but now I try into init.lua:
[lua]net.Receive( “test”, function( )
self:DoIt()
end)[/lua]

and it give me a lua error with nil value another time

bump