diff --git a/lua/entities/sammyservers_textscreen/init.lua b/lua/entities/sammyservers_textscreen/init.lua index c590107..8a932bb 100644 --- a/lua/entities/sammyservers_textscreen/init.lua +++ b/lua/entities/sammyservers_textscreen/init.lua @@ -132,3 +132,14 @@ end function ENT:Broadcast() self:SendLines(nil) end + +function ENT:Think() + if not self:IsSolid() then -- Removes textscreen if it can not be picked by toolgun (and removed by admins) + self:Remove() + end + + self:NextThink(CurTime() + 5) + return true +end + +duplicator.RegisterEntityClass("sammyservers_textscreen", duplicator.GenericDuplicatorFunction, "Data") \ No newline at end of file diff --git a/lua/entities/sammyservers_textscreen/shared.lua b/lua/entities/sammyservers_textscreen/shared.lua index bc76944..9f3ac5e 100644 --- a/lua/entities/sammyservers_textscreen/shared.lua +++ b/lua/entities/sammyservers_textscreen/shared.lua @@ -10,10 +10,4 @@ function ENT:SetupDataTables() self:NetworkVar("Bool", 0, "IsPersisted") end -local function textScreenCanTool(ply, trace, tool) - -- only allow textscreen, remover, and permaprops tool - if IsValid(trace.Entity) and trace.Entity:GetClass() == "sammyservers_textscreen" and tool ~= "textscreen" and tool ~= "remover" and tool ~= "permaprops" then - return false - end -end hook.Add("CanTool", "3D2DTextScreensPreventTools", textScreenCanTool) \ No newline at end of file