So I'm making a entity where when you press it. So when I press E (Use) on it rather than just make one derma panel it makes 3 (If i press E quick) and if I hold E down then it just keeps looping, making a infinite amount of derma panels. Here is the code I'm using, its really basic since Im new to glua.
Code:
Server Side:
[CODE]
function ENT:Use(activator, caller)
if caller:IsPlayer() then
net.Start("WD_OpenMenu")
net.Send(caller)
end
end
[/CODE]
Client Side:
[CODE]
net.Receive("WD_OpenMenu", function()
local wd_frame = vgui.Create("DFrame")
wd_frame:SetSize(100,100)
wd_frame:SetVisible(true)
wd_frame:Center()
wd_frame:MakePopup()
print("I was pressed") // This is just to let me know how many panels its making
end)
[/CODE]
[CODE]self:SetUseType( SIMPLE_USE )[/CODE]
in the initialize function of the entity.
Sorry, you need to Log In to post a reply to this thread.