• Help!
    1 replies, posted
[lua]SWEP.base = "weapon_base" SWEP.Category = "Other"; SWEP.Author = "Eddiedog8"; SWEP.Instructions = "Left Click To Use A Single Shot that does 1000 Damage , Right Click To Use A Automatic shot That does 10 Damage but shoots 10 bulets at a time at a time"; SWEP.PrintName = "Weapon_Admin_pistol"; SWEP.Slot = 6; SWEP.SlotPos = 3; SWEP.DrawCrosshair = true; SWEP.DrawAmmo = true; SWEP.ViewModel = "models/weapons/v_pistol.mdl"; SWEP.WorldModel = "models/weapons/w_pistol.mdl"; SWEP.ViewModelFOV = 64; SWEP.ReloadSound = "weapons/pistol/pistol_reload1.wav"; SWEP.HoldType = "pistol"; SWEP.Spawnable = false; SWEP.AdminSpawnable = true; SWEP.Weight = 0; SWEP.AutoSwitchTo = true; SWEP.AutoSwitchFrom = true; SWEP.FiresUnderwater = true; SWEP.Primary.Sound = "weapons/ar2/fire1.wav" SWEP.Primary.Tracer = 1; SWEP.Primary.Automatic = false; SWEP.Primary.Force = 9999; SWEP.Primary.FireFromHip = true; SWEP.Primary.Weld = false; SWEP.Primary.Ammo = "pistol"; SWEP.Primary.ExplosionShot = false; SWEP.Primary.BulletShot = true; SWEP.Primary.ModelShot = false; SWEP.Primary.BreakAll = true; SWEP.Primary.Ignite = false; SWEP.Primary.ClipSize = 9999; SWEP.Primary.DefaultClip =0; SWEP.Primary.Recoil = 0.00; SWEP.Primary.Damage = 1; SWEP.Primary.NumberofShots = 1; SWEP.Primary.Spread = 0; SWEP.Primary.Delay =0; SWEP.Primary.Model = "models/props_c17/FurnitureChair001a.mdl"; SWEP.Primary.ExplosionSound = "weapon_AWP.Single"; SWEP.Primary.ExplosionSoundDistance = 400; SWEP.Primary.ExplosionSize = 175; SWEP.Primary.TakeAmmo = 0; SWEP.Secondary.Sound = "weapons/ar2/fire1.wav" SWEP.Secondary.Tracer = 1; SWEP.Secondary.Force = 9999; SWEP.Secondary.Automatic = false; SWEP.Secondary.FireFromHip = true; SWEP.Secondary.Weld = false; SWEP.Secondary.ExplosionShot = false; SWEP.Secondary.BulletShot = true; SWEP.Secondary.ModelShot = false; SWEP.Secondary.BreakAll = false; SWEP.Secondary.Ignite = false; SWEP.Secondary.Recoil = 0.00; SWEP.Secondary.Spread = 10; SWEP.Secondary.Delay = 0; SWEP.Secondary.TakeAmmo = 0; SWEP.Secondary.Model = "models/props_c17/FurnitureChair001a.mdl"; SWEP.Secondary.ExplosionSound = "weapon_AWP.Single"; SWEP.Secondary.ExplosionSoundDistance = 400; SWEP.Secondary.ExplosionSize = 175; function SWEP:Initialize() util.PrecacheSound(self.Primary.Sound); util.PrecacheSound(self.Secondary.Sound); if ( SERVER ) then self:SetWeaponHoldType( self.HoldType ); end end function SWEP:PrimaryAttack() if ( !self:CanPrimaryAttack() ) then return end //Default stuff, normally used in any condition. local trace = self.Owner:GetEyeTrace(); self.Weapon:EmitSound ( self.Primary.Sound ); self:ShootEffects(); self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay ); self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay ); self:TakePrimaryAmmo(self.Primary.TakeAmmo); local rnda = -self.Primary.Recoil; local rndb = self.Primary.Recoil * math.random(-1, 1); self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) ); //The attack mode, can vary from the user settings if ( self.Primary.ExplosionShot ) then local explode = ents.Create( "env_explosion" ); explode:SetPos( trace.HitPos ); explode:SetOwner( self.Owner ); explode:Spawn(); explode:SetKeyValue( "iMagnitude", self.Primary.ExplosionSize ); explode:Fire( "Explode", 0, 0 ); explode:EmitSound( self.Primary.ExplosionSound, self.Primary.ExplosionSoundDistance, self.Primary.ExplosionSoundDistance ); end if ( self.Primary.BreakAll ) then if( trace.Entity:IsValid() and trace.Entity:GetClass() == "prop_physics" ) then constraint.RemoveAll( trace.Entity ); local physobject = trace.Entity:GetPhysicsObject(); physobject:EnableMotion( true ); physobject:SetVelocity( self.Owner:GetAimVector() * 2 ); end end if ( self.Primary.Ignite ) then if (!trace.Entity) then return false end if (!trace.Entity:IsValid() ) then return false end if (trace.Entity:IsPlayer()) then return false end if (trace.Entity:IsWorld()) then return false end if ( CLIENT ) then return true end local Time = math.random(20); trace.Entity:Extinguish(); trace.Entity:Ignite( Time, 0 ); end if ( self.Primary.BulletShot ) then 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, 0); bullet.Tracer = self.Primary.Tracer; bullet.Force = self.Primary.Force; bullet.Damage = self.Primary.Damage; bullet.AmmoType = self.Primary.Ammo; self.Owner:FireBullets( bullet ); end if ( self.Primary.ModelShot ) then if (!SERVER) then return end; local ent = ents.Create ("prop_physics"); ent:SetModel ( self.Primary.Model ); if ( self.Primary.FireFromHip ) then ent:SetPos (self.Owner:EyePos() + (self.Owner:GetAimVector() * 32)); else ent:SetPos (trace.HitPos + self.Owner:GetAimVector() * -16); end ent:SetAngles (self.Owner:EyeAngles()); ent:Spawn(); local phys = ent:GetPhysicsObject(); local shot_length = trace.HitPos:Length(); if ( self.Primary.Weld ) then local weld = constraint.Weld( trace.Entity, ent, trace.PhysicsBone, 0, 0 ); end phys:ApplyForceCenter (self.Owner:GetAimVector():GetNormalized() * math.pow (shot_length, 3)); cleanup.Add (self.Owner, "props", ent); undo.Create ("Thrown model"); undo.AddEntity (ent); undo.SetPlayer (self.Owner); undo.Finish(); end end function SWEP:SecondaryAttack() if ( !self:CanPrimaryAttack() ) then return end //Default stuff, normally used in any condition. local trace = self.Owner:GetEyeTrace(); self.Weapon:EmitSound ( self.Secondary.Sound ); self:ShootEffects(); self.Weapon:SetNextPrimaryFire( CurTime() + self.Secondary.Delay ); self.Weapon:SetNextSecondaryFire( CurTime() + self.Secondary.Delay ); self:TakePrimaryAmmo(self.Secondary.TakeAmmo); local rnda = -self.Secondary.Recoil; local rndb = self.Secondary.Recoil * math.random(-1, 1); self.Owner:ViewPunch( Angle( rnda,rndb,rnda ) ); //The attack mode, can vary from the user settings if ( self.Secondary.ExplosionShot ) then local explode = ents.Create( "env_explosion" ); explode:SetPos( trace.HitPos ); explode:SetOwner( self.Owner ); explode:Spawn(); explode:SetKeyValue( "iMagnitude", self.Secondary.ExplosionSize ); explode:Fire( "Explode", 0, 0 ); explode:EmitSound( self.Secondary.ExplosionSound, self.Secondary.ExplosionSoundDistance, self.Secondary.ExplosionSoundDistance ); end if ( self.Secondary.BreakAll ) then if( trace.Entity:IsValid() and trace.Entity:GetClass() == "prop_physics" ) then constraint.RemoveAll( trace.Entity ); local physobject = trace.Entity:GetPhysicsObject(); physobject:EnableMotion( true ); physobject:SetVelocity( self.Owner:GetAimVector() * 2 ); end end if ( self.Secondary.Ignite ) then if (!trace.Entity) then return false end if (!trace.Entity:IsValid() ) then return false end if (trace.Entity:IsPlayer()) then return false end if (trace.Entity:IsWorld()) then return false end if ( CLIENT ) then return true end local Time = math.random(20); trace.Entity:Extinguish(); trace.Entity:Ignite( Time, 0 ); end if (self.Secondary.BulletShot ) then local bullet = {}; bullet.Num = self.Secondary.NumberofShots; bullet.Src = self.Owner:GetShootPos(); bullet.Dir = self.Owner:GetAimVector(); bullet.Spread = Vector( self.Secondary.Spread * 0.1 , self.Secondary.Spread * 0.1, 0); bullet.Tracer = self.Secondary.Tracer; bullet.Force = self.Secondary.Force; bullet.Damag
You have ether instailed it wrong or you are just blind and cant see errors
Sorry, you need to Log In to post a reply to this thread.