Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local meta = FindMetaTable("Entity")
- if !isfunction(meta.isDoor) then
- function meta:isDoor()
- if not IsValid(self) then return false end
- local class = self:GetClass()
- if class == "func_door" or
- class == "func_door_rotating" or
- class == "prop_door_rotating" or
- class == "func_movelinear" or
- class == "prop_dynamic" then
- return true
- end
- return false
- end
- end
- hook.Add( "PlayerUse", "NoDoorSpam", function( ply, ent )
- if ent:IsDoor() then
- if !ent.LastDoorUse or CurTime() - ent.LastDoorUse > 1 then
- ent.LastDoorUse = CurTime()
- else
- return false
- end
- end
- end )
Advertisement
Add Comment
Please, Sign In to add comment