I just finished a swep, and i tried to test it, didnt show up. This happened to me before, and now i am fustrated, heres the lua: [lua] if (SERVER) then
AddCSLuaFile(“shared.lua”)
SWEP.HoldType = “ar2”
end
if ( CLIENT ) then
SWEP.PrintName = "Admin Para"
SWEP.Author = "Wombo"
SWEP.Slot = 2
SWEP.SlotPos = 1
SWEP.IconLetter = "b"
SWEP.Instructions = "Use left for a brutal machine gun"
SWEP.Contact = "Wombo194@comcast.net"
SWEP.Purpose = "To handle most mingbag situations"
killicon.AddFont( "weapon_ak47", "CSKillIcons", SWEP.IconLetter, Color( 255, 80, 0, 255 ) )
end
SWEP.Base = “swep_base”
SWEP.AdminSpawnable = true
SWEP.Spawnable = false
SWEP.ViewModel = “models/weapons/v_mach_m249para.mdl”
SWEP.WorldModel = “models/weapons/w_mach_m249para.mdl”
SWEP.ViewModelFlip = true
SWEP.DrawCrosshair = true
SWEP.Weight = 4
SWEP.AutoSwitchTo = false
SWEP.AutoSwitchFrom = false
SWEP.FiresUnderwater = true
SWEP.Category = “Admin”
SWEP.DrawAmmo = true
swep.ViewModelFOV = 64
SWEP.Primary.Sound = Sound(“Weapon_M249.Single”)
SWEP.Primary.Reload = Sound( “Weapon_M249.Reload” )
SWEP.Primary.Empty = Sound( “Weapon_M249.Empty” )
SWEP.Primary.Damage = 100000
SWEP.Primary.TakeAmmo = 1
SWEP.Primary.ClipSize = 100000
SWEP.Primary.Ammo = “smg1”
SWEP.Primary.DefaultClip = 10000
SWEP.Primary.Spread = .1
SWEP.Primary.NumbShots = 4
SWEP.Primary.Automatic = true
SWEP.Primary.Recoil = .2
SWEP.Primary.RecoilXRand = .3
SWEP.Primary.RecoilYRand = 0.1
SWEP.Primary.Delay = .1
SWEP.Primary.Force = 100000
SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = “none”
SWEP.IronSightsPos = Vector (-4.4153, 0, 2.1305)
SWEP.IronSightsAng = Vector (0, 0, 0)
SWEP.RunArmOffset = Vector (2.2344, -2.2257, 1.7539)
SWEP.RunArmAngle = Vector (-19.3086, 29.9962, 0)
self.Weapon:SetNextSecondaryFire( CurTime() + self.Primary.Delay )
self.Weapon:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
if ( !self:CanPrimaryAttack() ) then return end
self.Weapon:EmitSound( self.Primary.Sound )
self:TakePrimaryAmmo( 1 )
self.Owner:ViewPunch( Angle( math.Rand(-self.Primary.RecoilXRand,-self.Primary.RecoilXRand) * self.Primary.Recoil, math.Rand(self.Primary.RecoilYRand,-self.Primary.RecoilYRand) *self.Primary.Recoil, 0 ) )
end
function SWEP:Think()
local trace = self.Owner:GetEyeTrace()
if self.Owner:Health() < 100 then
self.Owner:SetHealth(self.Owner:Health()+1)
end
function SWEP:CanPrimaryAttack()
if ( self.Weapon:Clip1() <= 0 ) then
self:EmitSound( "Weapon_Pistol.Empty" )
self:SetNextPrimaryFire( CurTime() + 0.2 )
self:Reload()
return false
return true
end
function SWEP:Reload()
//if ( CLIENT ) then return end
self:SetIronsights( false )
if ( self.Weapon:GetNetworkedBool( "reloading", true ) ) then return end
if ( self.Weapon:Clip1() < self.Primary.ClipSize && self.Owner:GetAmmoCount( self.Primary.Ammo ) > 0 ) then
self.Weapon:SetNetworkedBool( "reloading", true )
self.Weapon:SetVar( "reloadtimer", CurTime() + 0.3 )
self.Weapon:SendWeaponAnim( ACT_VM_RELOAD )
end
function SWEP:ShootBullet( damage, num_bullets, aimcone )
local bullet = {}
bullet.Num = num_bullets
bullet.Src = self.Owner:GetShootPos() // Source
bullet.Dir = self.Owner:GetAimVector() // Dir of bullet
bullet.Spread = Vector( aimcone, aimcone, 0 ) // Aim Cone
bullet.Tracer = 5 // Show a tracer on every x bullets
bullet.TracerName = "Tracer" // what Tracer Effect should be used
bullet.Force = 300 // Amount of force to give to phys objects
bullet.Damage = damage
bullet.AmmoType = "smg"
self.Owner:FireBullets( bullet )
self:ShootEffects()
end
function SWEP:TakePrimaryAmmo( num )
if ( self.Weapon:Clip1() <= 0 ) then
if ( self:Ammo1() <= 0 ) then return end
self.Owner:RemoveAmmo( num, self.Weapon:GetPrimaryAmmoType() )
self.Weapon:SetClip1( self.Weapon:Clip1() - num )
return end
function SWEP:DrawWeaponSelection( x, y, wide, tall, alpha )
draw.SimpleText( <IconLetter>, <FontName>, x + wide/2, y + tall*0.2, Color( 255, 210, 0, 255 ), TEXT_ALIGN_CENTER )
function SWEP:DrawWorldModel()
self.Weapon:DrawModel()
function SWEP:Deploy()
self.Weapon:SendWeaponAnim(ACT_VM_DRAW)
return true
function SWEP:ShootEffects()
self:SendWeaponAnim( ACT_VM_PRIMARYATTACK ) // View model animation
self.Owner:MuzzleFlash() // Crappy muzzle light
self.Owner:SetAnimation( PLAYER_ATTACK1 ) // 3rd Person Animation
function SWEP:PrimaryAttack()
self.Weapon:EmitSound(“Weapon_M249.Single”)
self:ShootBullet( 150, 1, 0.75 )
self.Owner:ViewPunch( Angle( -1, 0, 0 ) )
end
function SWEP:Deploy()
self.Owner:SetRunSpeed(3000)
self.Owner:SetJumpPower(1200)
self.Owner:ChatPrint("")
return true
end
function SWEP:Holster()
self.Owner:SetRunSpeed(800)
self.Owner:SetJumpPower(300)
self.Owner:ChatPrint("")
self.Owner:SetHealth(90000)
return true
end
[/lua]
Edit:updated, will still not working, help.
Edit AGAIN: i cleaned the code up and added some stuff, but im still getting the same console error, which is the cause of it not showing up, what do i need to do?