Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. SWEP.Author = "Moochael"
  2. SWEP.Instructions = "Master Key to the City"
  3. SWEP.Contact = ""
  4. SWEP.Purpose = "Unlocks/locks any door"
  5.  
  6. SWEP.PrintName = "Master Key"
  7.  
  8. SWEP.ViewModelFOV = 62
  9. SWEP.ViewModelFlip = false
  10. SWEP.ViewModel = Model("models/weapons/c_crowbar.mdl")
  11. SWEP.WorldModel = Model("models/weapons/w_crowbar.mdl")
  12.  
  13. SWEP.UseHands = true
  14.  
  15. SWEP.Spawnable = true
  16. SWEP.AdminOnly = true
  17. SWEP.Category = "DarkRP (Utility)"
  18.  
  19. SWEP.Sound = Sound("physics/wood/wood_box_impact_hard3.wav")
  20.  
  21. SWEP.Primary.ClipSize = -1 -- Size of a clip
  22. SWEP.Primary.DefaultClip = 0 -- Default number of bullets in a clip
  23. SWEP.Primary.Automatic = false -- Automatic/Semi Auto
  24. SWEP.Primary.Ammo = ""
  25.  
  26. SWEP.Secondary.ClipSize = -1 -- Size of a clip
  27. SWEP.Secondary.DefaultClip = -1 -- Default number of bullets in a clip
  28. SWEP.Secondary.Automatic = false -- Automatic/Semi Auto
  29. SWEP.Secondary.Ammo = ""
  30.  
  31. function SWEP:Initialize()
  32. self:SetHoldType("normal")
  33. end
  34.  
  35. if CLIENT then
  36.  
  37. end
  38.  
  39. function SWEP:PrimaryAttack()
  40. local trace = self.Owner:GetEyeTrace()
  41. local ent = trace.Entity
  42.  
  43. if trace.HitPos:Distance(self.Owner:GetShootPos()) < 100 and ent.isDoor() then
  44. self:SetHoldType("slam")
  45. if SERVER then
  46. ent:keysLock()
  47. ent:Fire("close", "", .6)
  48. ent:Fire("setanimation", "close", .6)
  49. end
  50. self:SetHoldType("normal")
  51. end
  52. end
  53.  
  54. function SWEP:SecondaryAttack()
  55. local trace = self.Owner:GetEyeTrace()
  56. local ent = trace.Entity
  57.  
  58. if trace.HitPos:Distance(self.Owner:GetShootPos()) < 100 and ent.isDoor() then
  59. self:SetHoldType("slam")
  60. if SERVER then
  61. ent:keysUnLock()
  62. ent:Fire("open", "", .6)
  63. ent:Fire("setanimation", "open", .6)
  64. end
  65. self:SetHoldType("normal")
  66. end
  67. end
  68.  
  69. function SWEP:Holster()
  70. return true
  71. end
  72.  
  73. function SWEP:Think()
  74.  
  75. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement