Advertisement
Guest User

Untitled

a guest
Jun 11th, 2014
198
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if (SERVER) then
  2. AddCSLuaFile("shared.lua")
  3. end
  4.  
  5. SWEP.PrintName = "falling"
  6. SWEP.Base = "weapon_base"
  7.  
  8. SWEP.ViewModel = "models/weapons/c_falling.mdl"
  9. SWEP.WorldModel = ""
  10. SWEP.ViewModelFOV = 64
  11. SWEP.UseHands = true
  12.  
  13. SWEP.Primary.Ammo = "none"
  14.  
  15. SWEP.Spawnable = false
  16. SWEP.AdminSpawnable = false
  17.  
  18. SWEP.DrawCrosshair = false
  19. SWEP.HoldType = "normal"
  20.  
  21. SWEP.Slot = 6
  22.  
  23. SWEP.SwimDelay = 1
  24.  
  25. SWEP.Primary.Ammo = "none"
  26. SWEP.Primary.Clipsize = -1
  27. SWEP.Primary.DefaultClip = -1
  28.  
  29. SWEP.Secondary.Ammo = "none"
  30. SWEP.Secondary.Clipsize = -1
  31. SWEP.Secondary.DefaultClip = -1
  32.  
  33. SWEP.DrawAmmo = false
  34.  
  35. SWEP.HitGround = 0
  36.  
  37. local MFallingSound = {
  38. "vo/npc/male01/no02.wav",
  39. "vo/npc/male01/no01.wav",
  40. "vo/npc/male01/help01.wav",
  41. "vo/npc/male01/uhoh.wav",
  42. "vo/npc/male01/ohno.wav",
  43. "vo/npc/male01/watchout.wav",
  44. "vo/npc/male01/goodgod.wav"}
  45.  
  46.  
  47. local MHurtSound = {
  48. "vo/npc/male01/pain01.wav",
  49. "vo/npc/male01/pain02.wav",
  50. "vo/npc/male01/pain03.wav",
  51. "vo/npc/male01/pain04.wav",
  52. "vo/npc/male01/pain05.wav",
  53. "vo/npc/male01/pain06.wav",
  54. "vo/npc/male01/pain07.wav",
  55. "vo/npc/male01/pain08.wav",
  56. "vo/npc/male01/pain09.wav",
  57. "vo/npc/male01/startle01.wav",
  58. "vo/npc/male01/startle02.wav",}
  59.  
  60.  
  61. local BreakBone = {
  62. "physics/body/body_medium_break2.wav",
  63. "physics/body/body_medium_break3.wav"}
  64.  
  65.  
  66. function SWEP:Deploy()
  67. zesound = CreateSound(self, table.Random(MFallingSound))
  68. zesound:Play()
  69. zesound:ChangeVolume(0,1)
  70. local player = self:GetOwner()
  71. local vel = player:GetVelocity().z
  72. return true
  73. end
  74.  
  75. function SWEP:Holster()
  76. FallLoop:Stop()
  77. local player = self:GetOwner()
  78. if !player:IsOnGround() then
  79. return false
  80. end
  81. return true
  82. end
  83.  
  84. function SWEP:PrimaryAttack()
  85. return false
  86. end
  87.  
  88. function SWEP:SecondaryAttack()
  89. return false
  90. end
  91.  
  92. function SWEP:Reload()
  93. return false
  94. end
  95.  
  96.  
  97. function SWEP:Think()
  98. local player = self:GetOwner()
  99. if player:IsValid() then
  100. local vel = player:GetVelocity().z
  101. if vel == 0 then
  102. if player:OnGround() then
  103. zesound = CreateSound(self, table.Random(MHurtSound))
  104. zesound:Play()
  105. zesound:ChangeVolume(0,1)
  106. FallLoop:ChangeVolume(0,0.1)
  107. end
  108. FallLoop:ChangeVolume(0,0.1)
  109. local player = self:GetOwner()
  110. player:ConCommand("lastinv")
  111. if SERVER then
  112. player:StripWeapon(self:GetClass())
  113. end
  114. end
  115. end
  116. local player = self:GetOwner()
  117. local vel = player:GetVelocity().z
  118. self.Owner:ViewPunch(Angle(math.random(-0.1+vel/10000,0.1+vel/10000),math.random(-0.1+vel/10000,0.1+vel/10000),math.random(-0.1+vel/10000,0.1+vel/10000)))
  119. self.Owner:SetFOV(150,1)
  120. local player = self:GetOwner()
  121. local vModel = player:GetViewModel()
  122. -- Check if swimming
  123.  
  124. if player:WaterLevel() >= 3 then
  125. FallLoop:ChangeVolume(0,0.1)
  126. local player = self:GetOwner()
  127. RunConsoleCommand("GiveMeAGun")
  128. if SERVER then
  129. player:StripWeapon(self:GetClass())
  130. end
  131. end
  132. -- Check if falling and hit the ground
  133.  
  134. -- Make hands not go too fast
  135.  
  136. if IsValid(vModel) && IsValid(self:GetOwner()) then
  137. if IsValid(self:GetOwner()) then
  138. local vel = player:GetVelocity().z
  139. end
  140. //print(vel) --Debug stuff, don't touch it it will spam your console.
  141. vModel:SetPlaybackRate(1+vel/10000)
  142. end
  143.  
  144. FallLoop = CreateSound(self,"vehicles/fast_windloop1.wav")
  145. FallLoop:Play()
  146.  
  147. end
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement