Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile()
- SWEP.Printname = "Laser Pistol"
- SWEP.Author = "( CalvinTheSpaceCat )"
- SWEP.Instructions = "Left Click to shoot."
- SWEP.Spawnable = true
- SWEP.Category = "Calvin's SWEPS"
- SWEP.DrawCrosshair = 1
- SWEP.ReloadSound = "npc/assassin/ball_zap1.wav"
- SWEP.Primary.Sound = "AlyxEMP.Discharge"
- SWEP.Primary.Damage = 15
- SWEP.Primary.TakeAmmo = 1
- SWEP.Primary.ClipSize = 20
- SWEP.Primary.Ammo = "Pistol"
- SWEP.Primary.DefaultClip = 20
- SWEP.Primary.Spread = 0.1
- SWEP.Primary.NumberofShots = 1
- SWEP.Primary.Automatic = true
- SWEP.Primary.Recoil = 5
- SWEP.Primary.Delay = 0.9
- SWEP.Primary.Force = 1000
- SWEP.Primary.Delay = 0.1
- SWEP.Weight = 4
- SWEP.AutoSwitchTo = false
- SWEP.AutoSwitchFrom = false
- SWEP.Slot = 2
- SWEP.SlotPos = 2
- SWEP.DrawAmmo = true
- SWEP.DrawCrosshair =true
- SWEP.HoldType = "pistol"
- SWEP.ViewModelFOV = 74.094488188976
- SWEP.ViewModelFlip = false
- SWEP.ViewModel = "models/weapons/c_pistol.mdl"
- SWEP.WorldModel = "models/weapons/w_pistol.mdl"
- SWEP.ShowViewModel = true
- SWEP.ShowWorldModel = true
- SWEP.ViewModelBoneMods = {}
- SWEP.UseHands = true
- SWEP.base = "m9k_colt1911"
- SWEP.IronSightsPos = Vector(-6.301, 0.55, 2.47)
- SWEP.IronSightsAng = Vector(3.03, -2.481, 1.325)
- SWEP.VElements = {
- ["232"] = { type = "Model", model = "models/props_combine/combine_window001.mdl", bone = "ValveBiped.square", rel = "", pos = Vector(0, 11.237, 3.734), angle = Angle(-97.89, 23.597, -69.604), size = Vector(0.068, 0.032, 0.057), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} },
- ["New"] = { type = "Model", model = "models/Items/battery.mdl", bone = "ValveBiped.clip", rel = "", pos = Vector(0.307, 3.94, 3.569), angle = Angle(180, 93.002, -2.987), size = Vector(0.5, 0.5, 0.5), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} },
- ["orange"] = { type = "Model", model = "models/weapons/w_pistol.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(5.946, 1.776, -2.774), angle = Angle(-180, -0.065, 3.831), size = Vector(0.5, 0.504, 0.5), color = Color(255, 120, 0, 255), surpresslightning = false, material = "models/debug/debugwhite", skin = 0, bodygroup = {} }
- }
- SWEP.WElements = {
- ["232"] = { type = "Model", model = "models/props_combine/combine_window001.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(9.397, 1.957, -3.888), angle = Angle(9.689, 0, 0), size = Vector(0.068, 0.032, 0.048), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} },
- ["New"] = { type = "Model", model = "models/Items/battery.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(8.373, 1.531, 3.388), angle = Angle(89.749, 0, 0), size = Vector(0.5, 0.5, 0.68), color = Color(255, 255, 255, 255), surpresslightning = false, material = "", skin = 0, bodygroup = {} },
- ["orange"] = { type = "Model", model = "models/weapons/w_pistol.mdl", bone = "ValveBiped.Bip01_R_Hand", rel = "", pos = Vector(5.513, 2.257, -3.835), angle = Angle(0.649, -180, -179.28), size = Vector(0.5, 0.504, 0.5), color = Color(255, 120, 0, 255), surpresslightning = false, material = "models/debug/debugwhite", skin = 0, bodygroup = {} }
- }
- function SWEP:Initialize()
- util.PrecacheSound(self.Primary.Sound)
- util.PrecacheSound(self.Secondary.Sound)
- self:SetWeaponHoldType( self.HoldType )
- end
- function SWEP:PrimaryAttack()
- if ( !self:CanPrimaryAttack() ) then return end
- local bullet = {}
- bullet.Num = self.Primary.NumberofShots
- bullet.Src = self.Owner:GetShootPos()
- bullet.Dir = self.Owner:GetAimVector()
- bullet.Spread = Vector( self.Primary.Spread * 0.1 , self.Primary.Spread * 0.1, 1)
- //The above, sets how far the bullets spread from each other.
- bullet.Tracer = 1
- bullet.TracerName = "LaserTracer"
- bullet.Force = self.Primary.Force
- bullet.Damage = self.Primary.Damage
- bullet.AmmoType = self.Primary.Ammo
- local rnda = self.Primary.Recoil * 0.1
- local rndb = self.Primary.Recoil * math.random(0.1, 0.1)
- self:ShootEffects()
- self.Owner:FireBullets( bullet )
- self:EmitSound(Sound(self.Primary.Sound))
- self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) )
- self:TakePrimaryAmmo(self.Primary.TakeAmmo)
- self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
- end
- function SWEP:SecondaryAttack()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement