Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AdvDupe2 support, allow all tools (except ones causing #60) to be used on textscreens #90

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lua/entities/sammyservers_textscreen/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
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)
Loading