Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if SERVER then
- AddCSLuaFile( "shared.lua" )
- end
- SWEP.HoldType = "ar2"
- if CLIENT then
- SWEP.PrintName = " Boomstick "
- SWEP.Author = "TTT"
- SWEP.Slot = 6
- SWEP.Icon = "VGUI/ttt/icon_ump"
- SWEP.ViewModelFOV = 72
- SWEP.EquipMenuData = {
- type = "Weapon",
- desc = "Shocking shottgun"
- };
- end
- SWEP.Base = "weapon_tttbase"
- SWEP.Kind = WEAPON_EQUIP
- SWEP.CanBuy = {ROLE_DETECTIVE}
- SWEP.LimitedStock = True
- SWEP.Primary.Damage = 30
- SWEP.Primary.NumShots = 8
- SWEP.Primary.Delay = .07
- SWEP.Primary.Cone = 0.02
- SWEP.Primary.ClipSize = 5
- SWEP.Primary.ClipMax = 10
- SWEP.Primary.DefaultClip = 5
- SWEP.Primary.Automatic = true
- SWEP.Primary.Ammo = "buckshot"
- SWEP.AutoSpawnable = false
- SWEP.AmmoEnt = "item_ammo_buckshot_ttt"
- SWEP.Primary.Recoil = 3
- SWEP.Primary.Sound = Sound( "Weapon_M3.Single" )
- SWEP.ViewModel = "models/weapons/v_shot_m3super90.mdl"
- SWEP.WorldModel = "models/weapons/w_shot_m3super90.mdl"
- SWEP.HeadshotMultiplier = 4.5 -- brain fizz
- SWEP.IronSightsPos = Vector( 5.7, -3, 3 )
- SWEP.IronSightsAng = Vector( -1.5, 0.35, 2 )
- --SWEP.DeploySpeed = 3
- function SWEP:ShootBullet( dmg, recoil, numbul, cone )
- local sights = self:GetIronsights()
- function SWEP:FirePulse(force_bwd, force_lft)
- if not IsValid(self.Owner) then return end
- numbul = numbul or 1
- cone = cone or 0.01
- -- 10% accuracy bonus when sighting
- cone = sights and (cone * 0.9) or cone
- local bullet = {}
- bullet.Num = numbul
- bullet.Src = self.Owner:GetShootPos()
- bullet.Dir = self.Owner:GetAimVector()
- bullet.Spread = Vector( cone, cone, 0 )
- bullet.Tracer = 5
- bullet.Force = force_lft / 6
- bullet.Damage = dmg
- local owner = self.Owner
- local lft = force_lft / num
- local bwd = force_bwd / num
- bullet.Callback = function(att, tr, dmginfo)
- LocalPlayer():IsActiveDetective() = tr.Entity
- if SERVER and IsValid(ply) and ply:IsPlayer() and (not ply:IsFrozen()) then
- ply:SetGroundEntity(nil)
- ply:SetLocalVelocity(ply:GetVelocity())
- ply.was_pushed = {att=owner, t=CurTime()}
- end
- end
- if SERVER or (CLIENT and IsFirstTimePredicted()) then
- local ent = tr.Entity
- if (not tr.HitWorld) and IsValid(ent) then
- local edata = EffectData()
- edata:SetEntity(ent)
- edata:SetMagnitude(4)
- edata:SetScale(3)
- util.Effect("TeslaHitBoxes", edata)
- if SERVER and ent:IsPlayer() then
- local eyeang = ent:EyeAngles()
- local j = 10
- eyeang.pitch = math.Clamp(eyeang.pitch + math.Rand(-j, j), -90, 90)
- eyeang.yaw = math.Clamp(eyeang.yaw + math.Rand(-j, j), -90, 90)
- ent:SetEyeAngles(eyeang)
- end
- end
- end
- end
- self.Owner:FireBullets( bullet )
- self.Weapon:SendWeaponAnim(self.PrimaryAnim)
- -- Owner can die after firebullets, giving an error at muzzleflash
- if not IsValid(self.Owner) or not self.Owner:Alive() then return end
- self.Owner:MuzzleFlash()
- self.Owner:SetAnimation( PLAYER_ATTACK1 )
- if self.Owner:IsNPC() then return end
- if ((SinglePlayer() and SERVER) or
- ((not SinglePlayer()) and CLIENT and IsFirstTimePredicted() )) then
- -- reduce recoil if ironsighting
- recoil = sights and (recoil * 0.75) or recoil
- local eyeang = self.Owner:EyeAngles()
- eyeang.pitch = eyeang.pitch - recoil
- self.Owner:SetEyeAngles( eyeang )
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement