Guest User

Untitled

a guest
Sep 27th, 2018
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. local meta = FindMetaTable("Entity")
  2.  
  3. if !isfunction(meta.isDoor) then
  4.  
  5. function meta:isDoor()
  6. if not IsValid(self) then return false end
  7. local class = self:GetClass()
  8.  
  9. if class == "func_door" or
  10. class == "func_door_rotating" or
  11. class == "prop_door_rotating" or
  12. class == "func_movelinear" or
  13. class == "prop_dynamic" then
  14. return true
  15. end
  16. return false
  17. end
  18.  
  19. end
  20.  
  21. hook.Add( "PlayerUse", "NoDoorSpam", function( ply, ent )
  22.  
  23. if ent:IsDoor() then
  24.  
  25. if !ent.LastDoorUse or CurTime() - ent.LastDoorUse > 1 then
  26.  
  27. ent.LastDoorUse = CurTime()
  28.  
  29. else
  30.  
  31. return false
  32.  
  33. end
  34.  
  35. end
  36.  
  37. end )
Advertisement
Add Comment
Please, Sign In to add comment