-- ROCK SWEP SWEP.ViewModel = "models/weapons/v_pistol.mdl" SWEP.WorldModel = "models/weapons/w_props_junk/rock001a.mdl" SWEP.Weight = 5 SWEP.AutoSwitchTo = false SWEP.AutoSwitchFrom = false SWEP.PrintName = "Rock" SWEP.Slot = 1 SWEP.SlotPos = 5 SWEP.DrawAmmo = false SWEP.DrawCrosshair = false SWEP.Spawnable = true SWEP.AdminsSpawnable = false SWEP.Primary.ClipSize = -1 SWEP.Primary.DefaultClip = -1 SWEP.Primary.Automatic = true SWEP.Primary.Delay = 1.2 SWEP.Primary.Ammo = "none" SWEP.Secondary.ClipSize = 1 SWEP.Secondary.DefaultClip = 1 SWEP.Secondary.Automatic = false SWEP.Secondary.Ammo = "slam" SWEP.Primary.Delay = 3 function SWEP:Reload() end function SWEP:Think() end function SWEP:throw_attack(model) self.BaseClass.ShootEffects(self) if CLIENT 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() phys:ApplyForceCenter(self.Owner:GetAimVector():GetNormalized() * 2500) cleanup.Add(self.Owner, "props", ent) undo.Create("Rock") undo.AddEntity(ent) undo.SetPlayer(self.Owner) undo.Finish() end function SWEP:PrimaryAttack() self.Weapon:SetNextPrimaryFire(CurTime() + 0.3) local ang = self.Owner:GetAimVector() local spos = self.Owner:GetShootPos() local trace = {} trace.start = spos trace.endpos = spos + (ang * 150) trace.filter = self.Owner local tr = util.TraceLine(trace) if tr.HitNonWorld then local bullet = {} bullet.Num=5 bullet.Src = self.Owner:GetShootPos() bullet.Dir= self.Owner:GetAimVector() bullet.Spread = Vector(0.2,0.2,0.2) bullet.Tracer = 0 bullet.Force = 10 ullet.Damage = 10 self.Owner:FireBullets(bullet) self.Weapon:SendWeaponAnim(ACT_VM_HITCENTER) table.insert(self.plasmatable,self.plasma) end end function SWEP:SecondaryAttack() self:throw_attack("models/props_junk/rock001a.mdl") self:TakeSecondaryAmmo( 1 ) self.Owner:ViewPunch( Angle( -1, 1, 0 ) ) end