Aek177

TTT perk machine perkbottle

Jun 13th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1.  
  2. AddCSLuaFile()
  3.  
  4. SWEP.Author = "Hoff Edited by |Z| Max"
  5. SWEP.PrintName = "Perk Bottle"
  6.  
  7. SWEP.Base = "weapon_tttbase"
  8. SWEP.Kind = WEAPON_EQUIP2
  9.  
  10. SWEP.ViewModel = "models/hoff/animations/perks/juggernog/jug.mdl"
  11. SWEP.WorldModel = ""
  12.  
  13. SWEP.Primary.ClipSize = -1
  14. SWEP.Primary.DefaultClip = -1
  15. SWEP.Primary.Automatic = true
  16. SWEP.Primary.Ammo = "none"
  17. SWEP.Primary.Delay = 1
  18. SWEP.ViewModelFOV = 60
  19. SWEP.Secondary.ClipSize = -1
  20. SWEP.Secondary.DefaultClip = -1
  21. SWEP.Secondary.Automatic = false
  22. SWEP.Secondary.Ammo = "none"
  23. SWEP.Weight = 5
  24. SWEP.AutoSwitchTo = false
  25. SWEP.AutoSwitchFrom = false
  26.  
  27. SWEP.PrintName = "Juggernog"
  28. SWEP.Slot = 3
  29. SWEP.SlotPos = 1
  30. SWEP.DrawAmmo = false
  31. SWEP.DrawCrosshair = false
  32.  
  33. SWEP.CorrectModelPlacement = Vector(0,0,-1)
  34. SWEP.SwayScale = 0.01
  35. SWEP.BobScale = 0.01
  36.  
  37. function SWEP:Deploy()
  38. self.Weapon:EmitSound("hoff/animations/perks/buy_jug.wav")
  39. self.Weapon:SetNWString("isDrinkingPerk", true)
  40.  
  41. timer.Simple(0.5,function()
  42. if self.Owner:Alive() then
  43. self.Weapon:EmitSound("hoff/animations/perks/017f11fa.wav")
  44. self.Owner:ViewPunch( Angle( -1, 1, 0 ) )
  45. end
  46. end)
  47.  
  48. timer.Simple(1.3,function()
  49. if self.Owner:Alive() then
  50. self.Weapon:EmitSound("hoff/animations/perks/0180acfa.wav")
  51. self.Owner:ViewPunch( Angle( -2.5, 0, 0 ) )
  52. end
  53. end)
  54.  
  55. timer.Simple(2.3,function()
  56. if self.Owner:Alive() then
  57. self.Weapon:EmitSound("hoff/animations/perks/017c99be.wav")
  58. self.Owner:SetNWString("shouldBlurPerkScreen",true)
  59. timer.Simple(0.5,function() self.Owner:SetNWString("shouldBlurPerkScreen",false) end)
  60. SendUserMessage("ZARPPerkScreen", self.Owner)
  61. end
  62. end)
  63.  
  64. timer.Simple(3.1,function()
  65. if self.Owner:Alive() then
  66. self.Weapon:EmitSound("hoff/animations/perks/017bf9c0.wav")
  67. self.Weapon:SetNWBool("isDrinkingPerk",false)
  68. timer.Simple(0.1,function() self.Weapon:Remove() end)
  69. end
  70. end)
  71. end
  72.  
  73. function PerkScreenBlur()
  74. local matBlurScreen = Material( "pp/blurscreen" )
  75. local function perkBlurHUD()
  76. if LocalPlayer():GetNWBool("shouldBlurPerkScreen") then
  77. surface.SetMaterial( matBlurScreen )
  78. surface.SetDrawColor( 255, 255, 255, 255 )
  79.  
  80. matBlurScreen:SetFloat("$blur",6)
  81. render.UpdateScreenEffectTexture()
  82.  
  83. surface.DrawTexturedRect(0,0, ScrW(), ScrH())
  84.  
  85. surface.SetDrawColor(0,0,0,60)
  86. surface.DrawRect(0,0,ScrW(),ScrH())
  87. end
  88. end
  89. hook.Add( "HUDPaint", "perkBlurPaint", perkBlurHUD )
  90. timer.Simple(2,function() hook.Remove( "HUDPaint", "perkBlurPaint" ) end)
  91. end
  92. usermessage.Hook("ZARPPerkScreen", PerkScreenBlur)
  93.  
  94. function SWEP:Holster()
  95. if self.Weapon:GetNWBool("isDrinkingPerk") then
  96. return false
  97. else
  98. return true
  99. end
  100. end
  101.  
  102. function SWEP:PrimaryAttack()
  103.  
  104. end
  105.  
  106.  
  107. function SWEP:GetViewModelPosition( pos, ang )
  108. local Right = ang:Right()
  109. local Up = ang:Up()
  110. local Forward = ang:Forward()
  111. local Mul = 1.0
  112. local Offset = self.CorrectModelPlacement
  113.  
  114. pos = pos + Offset.x * Right * Mul
  115. pos = pos + Offset.y * Forward * Mul
  116. pos = pos + Offset.z * Up * Mul
  117.  
  118. return pos, ang
  119. end
  120.  
  121. function SWEP:SecondaryAttack()
  122.  
  123. end
  124.  
  125.  
  126. function SWEP:ShouldDropOnDie()
  127. return false
  128. end
Advertisement
Add Comment
Please, Sign In to add comment