Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SWEP.PrintName = "Fisticuffs"
- SWEP.Author = "Matthew 'DeadVCR' Suddaby"
- SWEP.Instructions = "Fist people."
- SWEP.Contact = "no@never.com"
- SWEP.Purpose = "to be a SWEP"
- SWEP.AdminSpawnable = false
- SWEP.Spawnable = true
- SWEP.ViewModelFOV = 54
- SWEP.ViewModel = Model( "models/weapons/rd_fisticuffs.mdl" )
- SWEP.WorldModel ""
- SWEP.UseHands = true
- SWEP.AutoSwitchTo = false
- SWEP.AutoSwitchFrom = true
- SWEP.Slot = 1
- SWEP.SlotPos = 4
- SWEP.HoldType = "Melee"
- SWEP.FiresUnderwater = true
- SWEP.Weight = 5
- SWEP.DrawCrosshair = false
- SWEP.Category = "Resonance Duel"
- SWEP.DrawAmmo = false
- SWEP.HitDistance = 48
- SWEP.base = "weapon_base"
- SWEP.Primary.ClipSize = -1
- SWEP.Primary.DefaultClip = -1
- SWEP.Primary.Automatic = true
- SWEP.Primary.Ammo = "none"
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Automatic = true
- SWEP.Secondary.Ammo = "none"
- local SwingSound = Sound( "WeaponFrag.Throw" )
- local HitSound = Sound( "Flesh.ImpactHard" )
- function SWEP:Initialize()
- self:SetHoldType( "fist" )
- end
- function SWEP:UpdateNextIdle()
- local vm = self.Owner:GetViewModel()
- self:SetNextIdle( CurTime() + vm:SequenceDuration() / vm:GetPlaybackRate() )
- end
- function SWEP:Deploy()
- local speed = GetConVarNumber( "sv_defaultdeployspeed" )
- local vm = self.Owner:GetViewModel()
- vm:SendViewModelMatchingSequence( vm:LookupSequence( "fists_draw" ) )
- vm:SetPlaybackRate( speed )
- self:SetNextPrimaryFire( CurTime() + vm:SequenceDuration() / speed )
- self:SetNextSecondaryFire( CurTime() + vm:SequenceDuration() / speed )
- self:UpdateNextIdle()
- if ( SERVER ) then
- self:SetCombo( 0 )
- end
- return true
- end
- function SWEP:SecondaryAttack()
- self:PrimaryAttack( true )
- end
- function SWEP:Think()
- local vm = self.Owner:GetViewModel()
- local curtime = CurTime()
- local idletime = self:GetNextIdle()
- if ( idletime > 0 && CurTime() > idletime ) then
- vm:SendViewModelMatchingSequence( vm:LookupSequence( "fists_idle_0" .. math.random( 1, 2 ) ) )
- self:UpdateNextIdle()
- end
- local meleetime = self:GetNextMeleeAttack()
- if ( meleetime > 0 && CurTime() > meleetime ) then
- self:DealDamage()
- self:SetNextMeleeAttack( 0 )
- end
- if ( SERVER && CurTime() > self:GetNextPrimaryFire() + 0.1 ) then
- self:SetCombo( 0 )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement