Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. AddCSLuaFile()
  2.  
  3. ENT.Type = "anim"
  4. ENT.WHK_Entity = true
  5.  
  6. if SERVER then
  7. function ENT:Initialize()
  8. self:SetModel(self.Model)
  9. self:PhysicsInit(SOLID_VPHYSICS)
  10.  
  11. self:SetUseType(SIMPLE_USE)
  12. end
  13. end
  14.  
  15. function ENT:Setowning_ent(ent)
  16. if ent:IsPlayer() then
  17. self:CPPISetOwner(ent)
  18. end
  19. end
  20.  
  21. function ENT:CanInteract(ply)
  22. return hook.Run("WHK_AllowInteraction", ply, self) == true
  23. end
  24.  
  25. function ENT:CanEditVariables(ply)
  26. return ply:IsAdmin() or self:CanInteract(ply)
  27. end
  28.  
  29. hook.Add("WHK_AllowInteraction", "WHK_Default", function(ply, ent)
  30. if ply == ent:CPPIGetOwner() then return true end
  31. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement