Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SWEP.PrintName = "Silenced Chair Gun"
- SWEP.Author = "Philip"
- SWEP.Instructions = "Left click to fire a chair!"
- SWEP.Spawnable = true
- SWEP.AdminOnly = true
- SWEP.Primary.ClipSize = -1
- SWEP.Primary.DefaultClip = -1
- SWEP.Primary.Automatic = true
- SWEP.Primary.Ammo = "none"
- SWEP.Secondary.ClipSize = -1
- SWEP.Secondary.DefaultClip = -1
- SWEP.Secondary.Automatic = true
- SWEP.Secondary.Ammo = false
- SWEP.Weight = 5
- SWEP.AutoSwitchTo = false
- SWEP.AutoSwitchFrom = false
- SWEP.Slot = 3
- SWEP.SlotPos = 4
- SWEP.DrawAmmo = false
- SWEP.DrawCrosshair = true
- SWEP.ViewModel = "models/weapons/v_357.mdl"
- SWEP.WorldModel = "models/weapons/w_357.mdl"
- local ShootSound = Sound("Metal.SawbladeStick")
- -- This will fire a chair automatically with the left click.
- -- OP fire rate at 0.1 seconds.
- function SWEP:PrimaryAttack()
- self.Weapon:SetNextPrimaryFire( CurTime() + 0.1 )
- self:ThrowChair( "models/pokeball/pokeball.mdl" )
- end
- -- This will fire a different chair with right click and goes as fast as you can click.
- function SWEP:SecondaryAttack()
- self:ThrowChair( "models/pokeball/pokeball.mdl" )
- end
- --This plays the shoot sound when we shoot the gun.
- --And some other shit idk about -Refer to site from Johnson-
- function SWEP:ThrowChair( model_file )
- self:EmitSound( ShootSound )
- if (CLIENT) then return end
- local ent = ent.Creat( "prop_physics" )
- if ( !IsValid( ent )) then return end
- ent:SetModel( model_file )
- ent:SetPos( self.Owner:EyePos() + (self.Owner:GetAimVector() * 16))
- ent:SetAngles( self.Owner:EyeAngles() )
- ent:Spawn()
- local phys = ent:GetPhysicsObject()
- if ( !IsValid( phys )) then ent:Remove() return end
- --Throwing of the chair is set here!
- local velocity = self.Owner:GetAimVector()
- velocity = velocity * 500
- velocity = velocity + (VectorRand() * 10)
- phys:ApplyForceCent( velocity )
- --Cleanup and undo
- cleanup.Add( self.Owner, "props", ent)
- undo.Create( "Thrown_Chair" )
- undo.AddEntity( ent )
- undo.SetPlayer( self.Owner )
- undo.Finish()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement