Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AddCSLuaFile()
- if SERVER then
- end
- if CLIENT then
- end
- function SWEP:PrimaryAttack
- if score = 1 then
- self.Weapon:SetNextPrimaryFire( CurTime() + 20 )
- self:SpawnDrone1( "dronesrewrite_medic" )
- elseif score = 2 then
- self.Weapon:SetNextPrimaryFire( CurTime() + 20 )
- self:SpawnDrone1( "dronesrewrite_balltur" )
- end
- local score = 0
- function SWEP:SecondaryAttack()
- score.add( 1 )
- end
- function SWEP:SpawnDrone1( model_file )
- self:EmitSound( ShootSound )
- if ( CLIENT ) then return end
- local ent = ents.Create( "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
- cleanup.Add( self.Owner, "props", ent )
- undo.Create( "Drone" )
- undo.AddEntity( ent )
- undo.SetPlayer( self.Owner )
- undo.Finish()
- SWEP.Author = "Corn Hub"
- SWEP.Purpose = "Custom for TheTrueDragonAce's server."
- SWEP.Instructions = "Left click to spawn selected drone, Right click to change through drones."
- SWEP.Category = "Deception"
- SWEP.Spawnable = true
- SWEP.ViewModel = "models/weapons/v_RPG.mdl"
- SWEP.WorldModel = "models/weapons/w_rocket_launcher.mdl"
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement