I have an entity that has 3d2d text, what I’m trying to do is when you release your use key from it the text disappears. I used networkedvar btw. It works when you first press E on it but after releasing the key, the text doesnt disappear.
function ENT:Initialize()
--INIT--
self:SetModel("models/props/de_nuke/crate_extrasmall.mdl")
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
self:SetPressing(false)
self:SetUseType(CONTINUOUS_USE)
local phys = self:GetPhysicsObject()
if phys:IsValid() then
phys:Wake()
end
end
function ENT:Use(activator,caller)
if caller:KeyPressed(IN_USE) then
self:SetPressing(true)
elseif caller:KeyReleased(IN_USE) then
self:SetPressing(false)
end
end
--CLIENT THIS IS BEING USED IN ENT:DRAW--
cam.Start3D2D(poss+offsets,angss,0.15)
if self:GetPressing() == true then
width = Lerp(FrameTime()*1,width,100)
surface.SetDrawColor(0,0,0,mainss)
surface.DrawOutlinedRect(-51,-451,102,32)
draw.RoundedBox(0,-50,-450,width,30,Color(230,10,30,mainss))
elseif self:GetPressing() == false then
draw.SimpleTextOutlined("FALSE","NewFontsz",0,-500,Color(255,255,255,mainss), TEXT_ALIGN_CENTER,0,2,Color(0,0,0,mainss))
end
cam.End3D2D()