feat: CanPermaProp hook

Return false to prevent a player from perma propping a ent
This commit is contained in:
Aron 2023-11-11 15:16:00 +01:00 committed by GitHub
parent 7a92d6f2bd
commit 28f6681f89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,6 +43,9 @@ function TOOL:LeftClick(trace)
if ent:IsPlayer() then ply:ChatPrint( "That is a player !" ) return end
if ent.PermaProps then ply:ChatPrint( "That entity is already permanent !" ) return end
local canPermaProp = hook.Run("PermaProps.CanPermaProp", ply, ent, self)
if canPermaProp ~= nil and canPermaProp == false then return end
local content = PermaProps.PPGetEntTable(ent)
if not content then return end