Animal Chubs Dec 15, 2013 @ 7:41pm
gears of war weapon swep help
hey i found this old script fow a gearos of war lancer and was trying to figure out why i keep getting script errors.

if ( SERVER ) then

AddCSLuaFile( "shared.lua" )

SWEP.HoldType = "smg1"

end

if ( CLIENT ) then

SWEP.PrintName = "Chainsaw gun V2.5"
SWEP.Author = "Left4Lune"

SWEP.Slot = 2
SWEP.SlotPos = 7
SWEP.ViewModelFOV = 76
SWEP.IconLetter = "x"

end
-----------------------Main functions----------------------------

-- function SWEP:Reload() --To do when reloading
-- end

function SWEP:Think() -- Called every frame
end

function SWEP:Deploy()
self.Weapon:EmitSound( "weapons/lancer/lancer_deploy.wav" )
self.Weapon:SendWeaponAnim( ACT_VM_DRAW )
end

function SWEP:Initialize()
for k, v in pairs ( sounds ) do
util.PrecacheSound( "weapons/lancer/saw_"..v..".wav" )
end
end

function SWEP:Reload()
self.Weapon:EmitSound( "weapons/lancer/lancer_reload.wav" )
self.Weapon:DefaultReload(ACT_VM_RELOAD)
end

function SWEP:Holster()
self.Weapon:SendWeaponAnim( ACT_VM_HOLSTER )
timer.Destroy( "IdleSound" )
return true
end

function SWEP:PrimaryAttack()
if self.Weapon:Clip1() == 0 then return end
bullet = {}
bullet.Num = 1
bullet.Src = self.Owner:GetShootPos()
bullet.Dir = self.Owner:GetAimVector()
bullet.Spread = Vector(.026,.026,.026)
bullet.Tracer = 1
bullet.Force = 12.3
bullet.Damage = 11
self.Owner:FireBullets( bullet )

self.Owner:ViewPunch( Angle( math.random(-.35,.35),math.random(-.35,.35),math.random(-.35,.35) ) )

self.Weapon:SetNextPrimaryFire(CurTime() + 0.09)
self.Weapon:EmitSound("weapons/lancer/lancer_fire.wav")
self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
self.Owner:SetAnimation( PLAYER_ATTACK1 )
self:TakePrimaryAmmo( 1 )
end

function SWEP:SecondaryAttack()
local tr = self.Owner:GetEyeTrace()
tr.endpos = self.Owner:GetPos() + (self.Owner:GetAimVector() * 150)
local length = (self.Owner:GetShootPos() - tr.Entity:GetPos()):Length()
self.Weapon:SendWeaponAnim( ACT_VM_SECONDARYATTACK )


if length <= 125 then
if tr.Entity:IsValid() and tr.Entity:IsNPC() or tr.Entity:IsPlayer() then
self.Weapon:EmitSound("weapons/lancer/saw_stab"..math.random( 1, 3 )..".wav")
self.Weapon:SendWeaponAnim( ACT_VM_HITCENTER )
util.BlastDamage(self.Owner, self.Owner, tr.HitPos, 4, math.random( 120, 160 ) )
local effectdata = EffectData()
effectdata:SetOrigin( tr.HitPos )
for i=1, 20 do
util.Effect( "bloodsplash_effect", effectdata )
end
elseif !tr.HitWorld then
self.Weapon:EmitSound("weapons/lancer/saw_hitwall1.wav")
self.Weapon:SendWeaponAnim( ACT_VM_HITCENTER )
util.BlastDamage(self.Owner, self.Owner, tr.HitPos, 4, math.random( 120, 160 ) )

local Pos1 = tr.HitPos + tr.HitNormal
local Pos2 = tr.HitPos - tr.HitNormal
util.Decal( "ManhackCut", Pos1, Pos2 )
end
else
self.Weapon:EmitSound( "weapons/lancer/saw_slash1.wav" )
self.Weapon:SendWeaponAnim( ACT_VM_MISSCENTER )
end
self.Weapon:SetNextPrimaryFire( CurTime() + 1.15 )
self.Weapon:SetNextSecondaryFire( CurTime() + 0.65 )
end
-------------------------------------------------------------------

------------General Swep Info---------------
SWEP.Author = "Lune66"
SWEP.Contact = "left4lune@hotmail.com =3"
SWEP.Purpose = "Saw and shoot people."
SWEP.Instructions = "The Lancer from Gears Of War 2."
SWEP.Spawnable = true
SWEP.AdminSpawnable = true
-----------------------------------------------

------------Models---------------------------
SWEP.ViewModelFlip = false
SWEP.ViewModel = "models/weapons/v_lancer.mdl"
SWEP.WorldModel = "models/weapons/w_lancer.mdl"
-----------------------------------------------

-------------Primary Fire Attributes----------------------------------------
SWEP.Primary.Delay = 0.09 --In seconds
SWEP.Primary.Recoil = 0.1 --Gun Kick
SWEP.Primary.Damage = 11 --Damage per Bullet
SWEP.Primary.NumShots = 1 --Number of shots per one fire
SWEP.Primary.Cone = 0 --Bullet Spread
SWEP.Primary.ClipSize = 50 --Use "-1 if there are no clips"
SWEP.Primary.DefaultClip = 550 --Number of shots in next clip
SWEP.Primary.Automatic = true --Pistol fire (false) or SMG fire (true)
SWEP.Primary.Ammo = "smg1" --Ammo Type
-------------End Primary Fire Attributes------------------------------------

-------------Secondary Fire Attributes-------------------------------------
SWEP.Secondary.Delay = 0.1
SWEP.Secondary.Recoil = -0.1
SWEP.Secondary.Damage = 0
SWEP.Secondary.NumShots = 1
SWEP.Secondary.Cone = 0
SWEP.Secondary.ClipSize = 1
SWEP.Secondary.DefaultClip = 2
SWEP.Secondary.Automatic = true
SWEP.Secondary.Ammo = "SMG1_grenade"
-------------End Secondary Fire Attributes--------------------------------
Date Posted: Dec 15, 2013 @ 7:41pm
Posts: 0