Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (SERVER) then
- AddCSLuaFile("shared.lua")
- end
- SWEP.PrintName = "falling"
- SWEP.Base = "weapon_base"
- SWEP.ViewModel = "models/weapons/c_falling.mdl"
- SWEP.WorldModel = ""
- SWEP.ViewModelFOV = 64
- SWEP.UseHands = true
- SWEP.Primary.Ammo = "none"
- SWEP.Spawnable = false
- SWEP.AdminSpawnable = false
- SWEP.DrawCrosshair = false
- SWEP.HoldType = "normal"
- SWEP.Slot = 6
- SWEP.SwimDelay = 1
- SWEP.Primary.Ammo = "none"
- SWEP.Primary.Clipsize = -1
- SWEP.Primary.DefaultClip = -1
- SWEP.Secondary.Ammo = "none"
- SWEP.Secondary.Clipsize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.DrawAmmo = false
- SWEP.HitGround = 0
- local MFallingSound = {
- "vo/npc/male01/no02.wav",
- "vo/npc/male01/no01.wav",
- "vo/npc/male01/help01.wav",
- "vo/npc/male01/uhoh.wav",
- "vo/npc/male01/ohno.wav",
- "vo/npc/male01/watchout.wav",
- "vo/npc/male01/goodgod.wav"}
- local MHurtSound = {
- "vo/npc/male01/pain01.wav",
- "vo/npc/male01/pain02.wav",
- "vo/npc/male01/pain03.wav",
- "vo/npc/male01/pain04.wav",
- "vo/npc/male01/pain05.wav",
- "vo/npc/male01/pain06.wav",
- "vo/npc/male01/pain07.wav",
- "vo/npc/male01/pain08.wav",
- "vo/npc/male01/pain09.wav",
- "vo/npc/male01/startle01.wav",
- "vo/npc/male01/startle02.wav",}
- local BreakBone = {
- "physics/body/body_medium_break2.wav",
- "physics/body/body_medium_break3.wav"}
- function SWEP:Deploy()
- zesound = CreateSound(self, table.Random(MFallingSound))
- zesound:Play()
- zesound:ChangeVolume(0,1)
- local player = self:GetOwner()
- local vel = player:GetVelocity().z
- return true
- end
- function SWEP:Holster()
- FallLoop:Stop()
- local player = self:GetOwner()
- if !player:IsOnGround() then
- return false
- end
- return true
- end
- function SWEP:PrimaryAttack()
- return false
- end
- function SWEP:SecondaryAttack()
- return false
- end
- function SWEP:Reload()
- return false
- end
- function SWEP:Think()
- local player = self:GetOwner()
- if player:IsValid() then
- local vel = player:GetVelocity().z
- if vel == 0 then
- if player:OnGround() then
- zesound = CreateSound(self, table.Random(MHurtSound))
- zesound:Play()
- zesound:ChangeVolume(0,1)
- FallLoop:ChangeVolume(0,0.1)
- end
- FallLoop:ChangeVolume(0,0.1)
- local player = self:GetOwner()
- player:ConCommand("lastinv")
- if SERVER then
- player:StripWeapon(self:GetClass())
- end
- end
- end
- local player = self:GetOwner()
- local vel = player:GetVelocity().z
- 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)))
- self.Owner:SetFOV(150,1)
- local player = self:GetOwner()
- local vModel = player:GetViewModel()
- -- Check if swimming
- if player:WaterLevel() >= 3 then
- FallLoop:ChangeVolume(0,0.1)
- local player = self:GetOwner()
- RunConsoleCommand("GiveMeAGun")
- if SERVER then
- player:StripWeapon(self:GetClass())
- end
- end
- -- Check if falling and hit the ground
- -- Make hands not go too fast
- if IsValid(vModel) && IsValid(self:GetOwner()) then
- if IsValid(self:GetOwner()) then
- local vel = player:GetVelocity().z
- end
- //print(vel) --Debug stuff, don't touch it it will spam your console.
- vModel:SetPlaybackRate(1+vel/10000)
- end
- FallLoop = CreateSound(self,"vehicles/fast_windloop1.wav")
- FallLoop:Play()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement