Skip to content

Commit

Permalink
Changed the way #60 is fixed.
Browse files Browse the repository at this point in the history
Now any other tool can be used on textscreens.
  • Loading branch information
stepa2 committed Mar 8, 2024
1 parent 2b3a5c4 commit 927ccd8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 9 additions & 0 deletions lua/entities/sammyservers_textscreen/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,12 @@ 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
6 changes: 0 additions & 6 deletions lua/entities/sammyservers_textscreen/shared.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 927ccd8

Please sign in to comment.