• Prop Throwing Speed?
    1 replies, posted
I made a SWEP with a SWEP Maker, it shoots bricks. But how on earth can I make the bricks shoot faster? Here's the script, I want the bricks to shoot really fast and hard, what should I change? //General Variables\\ SWEP.AdminSpawnable = true SWEP.ViewModelFOV = 64 SWEP.ViewModel = "[Choose different Model]" SWEP.WorldModel = "models/weapons/w_pistol.mdl" SWEP.AutoSwitchTo = false SWEP.Slot = 1 SWEP.HoldType = "melee" SWEP.PrintName = "Brick Shooter" SWEP.Author = "Zealord" SWEP.Spawnable = true SWEP.AutoSwitchFrom = false SWEP.FiresUnderwater = true SWEP.Weight = 5 SWEP.DrawCrosshair = true SWEP.Category = "Ad's Stuff" SWEP.SlotPos = 0 SWEP.DrawAmmo = true SWEP.ReloadSound = "Weapon_Pistol.Reload" SWEP.Instructions = " " SWEP.Contact = "N/A" SWEP.Purpose = "Shoot bricks at things, just like hobo's." SWEP.base = "weapon_base" //General Variables\\ //Primary Fire Variables\\ SWEP.Primary.Sound = "Weapon_Pistol.Single" SWEP.Primary.Damage = 10 SWEP.Primary.TakeAmmo = 1 SWEP.Primary.ClipSize = 1 SWEP.Primary.AngVelocity = Angle(0,0,0) SWEP.Primary.Ammo = "Pistol" SWEP.Primary.DefaultClip = 2 SWEP.Primary.Spread = 0.1 SWEP.Primary.Model = "models/props_junk/CinderBlock01a.mdl" SWEP.Primary.NumberofShots = 1 SWEP.Primary.Automatic = false SWEP.Primary.Recoil = 1 SWEP.Primary.Delay = 0.2 SWEP.Primary.Force = 9000 //Primary Fire Variables\\ //Secondary Fire Variables\\ SWEP.Secondary.NumberofShots = 1 SWEP.Secondary.Force = 10 SWEP.Secondary.Spread = 0.1 SWEP.Secondary.Sound = "Weapon_Pistol.Single" SWEP.Secondary.DefaultClip = 32 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "Pistol" SWEP.Secondary.Recoil = 1 SWEP.Secondary.Delay = 0.2 SWEP.Secondary.TakeAmmo = 1 SWEP.Secondary.ClipSize = 16 SWEP.Secondary.Damage = 10 //Secondary Fire Variables\\ //SWEP:Initialize()\\ function SWEP:Initialize() util.PrecacheSound(self.Primary.Sound) util.PrecacheSound(self.Secondary.Sound) if ( SERVER ) then self:SetWeaponHoldType( self.HoldType ) end end //SWEP:Initialize()\\ //SWEP:PrimaryFire()\\ function SWEP:PrimaryAttack() self:TakePrimaryAmmo(self.Primary.TakeAmmo) self:Throw_Attack (self.Primary.Model, self.Primary.Sound, self.Primary.AngVelocity) self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay ) self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay ) end //SWEP:PrimaryFire()\\ //SWEP:SecondaryFire()\\ function SWEP:SecondaryFire() return false end //SWEP:SecondaryFire()\\ //SWEP:Throw_Attack(Model, Sound, Angle)\\ function SWEP:Throw_Attack (Model, Sound, Angle) local tr = self.Owner:GetEyeTrace() self.Weapon:EmitSound (Sound) self.BaseClass.ShootEffects (self) if (!SERVER) then return end local ent = ents.Create ("prop_physics") ent:SetModel (Model) ent:SetPos (self.Owner:EyePos() + (self.Owner:GetAimVector() * 16)) ent:SetAngles (self.Owner:EyeAngles()) ent:Spawn() local phys = ent:GetPhysicsObject() local shot_length = tr.HitPos:Length() phys:ApplyForceCenter (self.Owner:GetAimVector():GetNormalized() * math.pow (shot_length, 90)) phys:AddAngleVelocity(Angle) cleanup.Add (self.Owner, "props", ent) undo.Create ("Brick") undo.AddEntity (ent) undo.SetPlayer (self.Owner) undo.Finish() end //Throw_Attack(Model, Sound, Angle)\\
[QUOTE=boozerbear;18005880]I made a SWEP with a SWEP Maker, it shoots bricks. But how on earth can I make the bricks shoot faster? Here's the script, I want the bricks to shoot really fast and hard, what should I change?[/QUOTE] Use [lua] tags... [lua] //General Variables\\ SWEP.AdminSpawnable = true SWEP.ViewModelFOV = 64 SWEP.ViewModel = "[Choose different Model]" SWEP.WorldModel = "models/weapons/w_pistol.mdl" SWEP.AutoSwitchTo = false SWEP.Slot = 1 SWEP.HoldType = "melee" SWEP.PrintName = "Brick Shooter" SWEP.Author = "Zealord" SWEP.Spawnable = true SWEP.AutoSwitchFrom = false SWEP.FiresUnderwater = true SWEP.Weight = 5 SWEP.DrawCrosshair = true SWEP.Category = "Ad's Stuff" SWEP.SlotPos = 0 SWEP.DrawAmmo = true SWEP.ReloadSound = "Weapon_Pistol.Reload" SWEP.Instructions = " " SWEP.Contact = "N/A" SWEP.Purpose = "Shoot bricks at things, just like hobo's." SWEP.base = "weapon_base" //General Variables\\ //Primary Fire Variables\\ SWEP.Primary.Sound = "Weapon_Pistol.Single" SWEP.Primary.Damage = 10 SWEP.Primary.TakeAmmo = 1 SWEP.Primary.ClipSize = 1 SWEP.Primary.AngVelocity = Angle(0,0,0) SWEP.Primary.Ammo = "Pistol" SWEP.Primary.DefaultClip = 2 SWEP.Primary.Spread = 0.1 SWEP.Primary.Model = "models/props_junk/CinderBlock01a.mdl" SWEP.Primary.NumberofShots = 1 SWEP.Primary.Automatic = false SWEP.Primary.Recoil = 1 SWEP.Primary.Delay = 0.2 SWEP.Primary.Force = 9000 //Primary Fire Variables\\ //Secondary Fire Variables\\ SWEP.Secondary.NumberofShots = 1 SWEP.Secondary.Force = 10 SWEP.Secondary.Spread = 0.1 SWEP.Secondary.Sound = "Weapon_Pistol.Single" SWEP.Secondary.DefaultClip = 32 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "Pistol" SWEP.Secondary.Recoil = 1 SWEP.Secondary.Delay = 0.2 SWEP.Secondary.TakeAmmo = 1 SWEP.Secondary.ClipSize = 16 SWEP.Secondary.Damage = 10 //Secondary Fire Variables\\ //SWEP:Initialize()\\ function SWEP:Initialize() util.PrecacheSound(self.Primary.Sound) util.PrecacheSound(self.Secondary.Sound) if ( SERVER ) then self:SetWeaponHoldType( self.HoldType ) end end //SWEP:Initialize()\\ //SWEP:PrimaryFire()\\ function SWEP:PrimaryAttack() self:TakePrimaryAmmo(self.Primary.TakeAmmo) self:Throw_Attack (self.Primary.Model, self.Primary.Sound, self.Primary.AngVelocity) self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay ) self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay ) end //SWEP:PrimaryFire()\\ //SWEP:SecondaryFire()\\ function SWEP:SecondaryFire() return false end //SWEP:SecondaryFire()\\ //SWEP:Throw_Attack(Model, Sound, Angle)\\ function SWEP:Throw_Attack (Model, Sound, Angle) local tr = self.Owner:GetEyeTrace() self.Weapon:EmitSound (Sound) self.BaseClass.ShootEffects (self) if (!SERVER) then return end local ent = ents.Create ("prop_physics") ent:SetModel (Model) ent:SetPos (self.Owner:EyePos() + (self.Owner:GetAimVector() * 16)) ent:SetAngles (self.Owner:EyeAngles()) ent:Spawn() local phys = ent:GetPhysicsObject() local shot_length = tr.HitPos:Length() phys:ApplyForceCenter (self.Owner:GetAimVector():GetNormalized() * math.pow (shot_length, 90)) phys:AddAngleVelocity(Angle) cleanup.Add (self.Owner, "props", ent) undo.Create ("Brick") undo.AddEntity (ent) undo.SetPlayer (self.Owner) undo.Finish() end //Throw_Attack(Model, Sound, Angle)\\[/lua] And you probably have to edit line 96.
Sorry, you need to Log In to post a reply to this thread.