My Entite Opens 4 Derma Menus


AddCSLuaFile("cl_init.lua")

AddCSLuaFile("shared.lua")

include("shared.lua")




function ENT:Initialize()

	self:SetModel("models/noble/trailermessageboard/trailermessageboard.mdl")
	self:PhysicsInit(SOLID_VPHYSICS)
	self:SetMoveType(MOVETYPE_VPHYSICS)
	self:SetSolid(SOLID_VPHYSICS)

	local phys = self:GetPhysicsObject()

	if phys:IsValid() then

		phys:Wake()

	end
end


function ENT:Use( ply, caller )
    umsg.Start( "DermaPanel1", ply )
        umsg.Short( "1" ) 
    umsg.End() 
end


ENT.Type = "anim"
ENT.Base = "base_gmodentity"

ENT.PrintName = "Quest's Sign :)"

ENT.Spawnable = true


include("shared.lua")

function ENT:Draw()

	self:DrawModel()


end

local function DermaPanel1() 
  
    local DermaPanel1 = vgui.Create('DFrame')
    DermaPanel1:SetSize(100, 79)
    DermaPanel1:Center()
    DermaPanel1:SetTitle('Options')
    DermaPanel1:ShowCloseButton(true)
    DermaPanel1:SetSizable(false)
    DermaPanel1:SetDeleteOnClose(true)
    DermaPanel1:MakePopup()

end
usermessage.Hook( "DermaPanel1", DermaPanel1 )

Can anyone help? When I press E on it, 4 open instead of one

Use this instead of your ENT:Use:



function ENT:Use( ply, caller )
    if (ply.my_Ent_cool or 0) > CurTime() then return end
    ply.my_Ent_cool = CurTime() + 0.5
    umsg.Start( "DermaPanel1", ply )
        umsg.Short( "1" ) 
    umsg.End() 
end


Also you should use net messages instead of usermessages

:snip:

Did you try to search this issue before? I think it gets posted almost 3 times EVERY WEEK
You have to use SetUseType(SIMPLE_USE)

Edit: Didn’t know ENTITY:SetUseType existed!

Thanks! I’ve changed it so it uses Derma_StringRequest . How would I put the String that is inputted on the entity using 3D2D?

With variables, a bit of networking and some simple coding ingenuity.