Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if SERVER then
- resource.AddFile("models/weapons/w_357_rusty.mdl")
- AddCSLuaFile()
- end
- SWEP.Author = "RobZ51"
- SWEP.Instructions = ""
- SWEP.HoldType = "pistol"
- SWEP.Slot = 6
- SWEP.SlotPos = 3
- SWEP.Spawnable = false
- SWEP.AdminSpawnable = true
- SWEP.Base = "weapon_tttbase"
- SWEP.ViewModel = "models/weapons/v_357_rusty.mdl"
- SWEP.WorldModel = "models/weapons/w_357.mdl"
- SWEP.AmmoEnt = "item_ammo_357_ttt"
- SWEP.Primary.Sound = Sound( "weapons/357_fire2.wav" )
- SWEP.Primary.Recoil = 20
- SWEP.Primary.Damage = 60
- SWEP.Primary.NumShots = 1
- SWEP.Primary.Cone = 0.05
- SWEP.Primary.ClipSize = 6
- SWEP.Primary.Delay = 1.2
- SWEP.Primary.DefaultClip = 6
- SWEP.Primary.Automatic = false
- SWEP.Primary.Ammo = "357"
- SWEP.SlotPos = 1
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Automatic = false
- SWEP.Secondary.Ammo = "none"
- SWEP.Weight = 5
- SWEP.AutoSwitchTo = false
- SWEP.AutoSwitchFrom = false
- SWEP.PrintName = "Rusty .357"
- SWEP.DrawAmmo = true
- SWEP.DrawCrosshair = true
- SWEP.ViewModelFOV = 55
- SWEP.ViewModelFlip = false
- SWEP.NoSights = true
- SWEP.Kind = WEAPON_EQUIP
- SWEP.CanBuy = {ROLE_TRAITOR}
- SWEP.LimitedStock = true
- SWEP.Icon = "VGUI/ttt/icon_rusty"
- /*---------------------------------------------------------
- Reload does nothing
- ---------------------------------------------------------*/
- function SWEP:Reload()
- self.Weapon:DefaultReload( ACT_VM_RELOAD )
- end
- /*---------------------------------------------------------
- Think does nothing
- ---------------------------------------------------------*/
- function SWEP:Think()
- end
- /*---------------------------------------------------------
- PrimaryAttack
- ---------------------------------------------------------*/
- function SWEP:PrimaryAttack()
- self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
- self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
- if ( !self:CanPrimaryAttack() ) then return end
- self.Weapon:EmitSound( self.Primary.Sound )
- // Shoot the bullet
- self:ShootBullet( self.Primary.Damage, self.Primary.Recoil, self.Primary.NumShots, self.Primary.Cone )
- self:TakePrimaryAmmo( 1 )
- self.Owner:ViewPunch( Angle( math.Rand(-0.2,-0.1) * self.Primary.Recoil, math.Rand(-0.1,0.1) *self.Primary.Recoil, 0 ) )
- local explode = math.random(10)
- if(explode == 5) then
- self.Weapon:EmitSound ( "weapons/c4/c4_explode1.wav",50)
- local effectdata = EffectData()
- effectdata:SetStart( self:GetPos() ) // not sure if we need a start and origin (endpoint) for this effect, but whatever
- effectdata:SetOrigin( self:GetPos() )
- effectdata:SetScale( 0.01 )
- util.Effect( "HelicopterMegaBomb", effectdata, true, true )
- util.BlastDamage( self.Owner, self.Owner, self:GetPos(), 200, 100 )
- if SERVER then
- self.Owner:StripWeapon(self:GetClass())
- end
- end
- end
- function SWEP:ShootBullet( dmg, recoil, numbul, cone )
- numbul = numbul or 1
- cone = cone or 0.01
- local bullet = {}
- bullet.Num = numbul
- bullet.Src = self.Owner:GetShootPos() // Source
- bullet.Dir = self.Owner:GetAimVector() // Dir of bullet
- bullet.Spread = Vector( cone, cone, 0 ) // Aim Cone
- bullet.Tracer = 4 // Show a tracer on every x bullets
- bullet.Force = 5 // Amount of force to give to phys objects
- bullet.Damage = dmg
- self.Owner:FireBullets( bullet )
- self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) // View model animation
- self.Owner:MuzzleFlash() // Crappy muzzle light
- self.Owner:SetAnimation( PLAYER_ATTACK1 ) // 3rd Person Animation
- if ( self.Owner:IsNPC() ) then return end
- end
- function SWEP:SecondaryAttack()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement