Line # has whatever error, but there is no problem, how so?

I’ve been scripting some sweps, and for some reason the weapon bases are exactly the way they were from the original author’s version, yet errors come up only when I change the folder name to something else. Example,
[lua]
include(‘shared.lua’)

SWEP.PrintName = “Siminov’s Weapon Base” // ‘Nice’ Weapon name (Shown on HUD)
SWEP.Slot = 0 // Slot in the weapon selection menu
SWEP.SlotPos = 1 // Position in the slot
SWEP.DrawAmmo = true // Should draw the default HL2 ammo counter?
SWEP.DrawCrosshair = false // Should draw the default crosshair?
SWEP.DrawWeaponInfoBox = true // Should draw the weapon info box?
SWEP.BounceWeaponIcon = false // Should the weapon icon bounce?
SWEP.SwayScale = 1.0 // The scale of the viewmodel sway
SWEP.BobScale = 1.0 // The scale of the viewmodel bob

SWEP.RenderGroup = RENDERGROUP_OPAQUE

// Override this in your SWEP to set the icon in the weapon selection
if (file.Exists("…/materials/weapons/swep.vmt")) then
SWEP.WepSelectIcon = surface.GetTextureID(“weapons/swep”)
end

// This is the corner of the speech bubble
if (file.Exists("…/materials/gui/speech_lid.vmt")) then
SWEP.SpeechBubbleLid = surface.GetTextureID(“gui/speech_lid”)
end

language.Add(“buckshot_ammo”, “12 Gauge Shells”) // 357
language.Add(“357_ammo”, “.357 Magnum Ammo”) // 357
language.Add(“airboatgun_ammo”, “5.56MM Ammo”) // AirboatGun = 5.56MM Ammo (M249, FAMAS, SG-550, SG-552, Galil, M4A1)
language.Add(“gaussenergy_ammo”, “.30-06 Ammo”) // Gravity = 4.6MM Ammo (MP7)
language.Add(“alyxgun_ammo”, “5.7MM Ammo”) // AlyxGun = 5.7MM Ammo (Five-Seven, P90)
language.Add(“battery_ammo”, “9MM Ammo”) // Battery = 9MM Ammo (Glock, MP5, P228, USP, TMP)
language.Add(“striderminigun_ammo”, “7.62MM Ammo”) // StriderMinigun = 7.62MM Ammo (AK-47, SCOUT, G3, Aug, AWP, Scout)
language.Add(“sniperpenetratedround_ammo”, “.45Acp Ammo”) // SniperRound = .45 Ammo (MAC10, UMP)
language.Add(“combinecannon_ammo”, “.50AE Ammo”) // CombineCannon = .50 Ammo (Desert Eagle)
language.Add(“helicoptergun_ammo”, “5.45MM Ammo”) // Thumper = Explosive Ammo (C4)
language.Add(“sniperround_ammo”, “7.62MM Pistol Ammo”)
language.Add(“slam_ammo”, “7.92MM Ammo”) // Thumper
language.Add(“ar2altfire_ammo”, “.30 Carbine Ammo”)
/---------------------------------------------------------
Name: SWEP:SecondDrawHUD()
---------------------------------------------------------
/
function SWEP:SecondDrawHUD()
end

/---------------------------------------------------------
Name: SWEP:DrawHUD()
Desc: You can draw to the HUD here. It will only draw when
the client has the weapon deployed.
---------------------------------------------------------
/
cl_crosshair_r = CreateClientConVar(“sim_crosshair_r”, 255, true, false) // Red
cl_crosshair_g = CreateClientConVar(“sim_crosshair_g”, 255, true, false) // Green
cl_crosshair_b = CreateClientConVar(“sim_crosshair_b”, 255, true, false) // Blue
cl_crosshair_a = CreateClientConVar(“sim_crosshair_a”, 200, true, false) // Alpha
cl_crosshair_l = CreateClientConVar(“sim_crosshair_l”, 30, true, false) // Lenght
cl_crosshair_t = CreateClientConVar(“sim_crosshair_t”, 1, true, false) // Enable/Disable

function SWEP:DrawHUD()

self:SecondDrawHUD()
self:DrawFuelHUD()

if (self.Weapon:GetDTBool(1)) or (cl_crosshair_t:GetBool() == false) or (LocalPlayer():InVehicle()) then return end

local hitpos = util.TraceLine ({
	start = LocalPlayer():GetShootPos(),
	endpos = LocalPlayer():GetShootPos() + LocalPlayer():GetAimVector() * 4096,
	filter = LocalPlayer(),
	mask = MASK_SHOT
}).HitPos

local screenpos = hitpos:ToScreen()

local x = screenpos.x
local y = screenpos.y

if self.Primary.Cone < 0.005 then
	self.Primary.Cone = 0.005
end

local gap = ((self.Primary.Cone * 275) + (((self.Primary.Cone * 275) * (ScrH() / 720))) * (1 / self:CrosshairAccuracy())) * 0.75

gap = math.Clamp(gap, 0, (ScrH() / 2) - 100)
local length = cl_crosshair_l:GetInt()

self:DrawCrosshairHUD(x - gap - length, y - 1, length, 3) 	// Left
self:DrawCrosshairHUD(x + gap + 1, y - 1, length, 3) 		// Right
self:DrawCrosshairHUD(x - 1, y - gap - length, 3, length) 	// Top 
self:DrawCrosshairHUD(x - 1, y + gap + 1, 3, length) 		// Bottom

end

/---------------------------------------------------------
Name: SWEP:DrawCrosshairHUD()
---------------------------------------------------------
/
function SWEP:DrawCrosshairHUD(x, y, width, height)

surface.SetDrawColor(0, 0, 0, cl_crosshair_a:GetInt() / 2)
surface.DrawRect(x, y, width, height)

surface.SetDrawColor(cl_crosshair_r:GetInt(), cl_crosshair_g:GetInt(), cl_crosshair_b:GetInt(), cl_crosshair_a:GetInt())
surface.DrawRect(x + 1, y + 1, width - 2, height - 2)

end

/---------------------------------------------------------
Name: SWEP:DrawFuelHUD()
---------------------------------------------------------
/
// Based on the Condition SWEPs HUD made by SB Spy

function SWEP:DrawFuelHUD()
end

/---------------------------------------------------------
Name: SWEP:DrawWeaponSelection()
Desc: Checks the objects before any action is taken.
This is to make sure that the entities haven’t been removed.
---------------------------------------------------------
/
function SWEP:DrawWeaponSelection(x, y, wide, tall, alpha)

// Set us up the texture
surface.SetDrawColor(255, 255, 255, alpha)
surface.SetTexture(self.WepSelectIcon)

// Lets get a sin wave to make it bounce
local fsin = 0

if (self.BounceWeaponIcon == true) then
	fsin = math.sin(CurTime() * 10) * 5
end

// Borders
y = y + 10
x = x + 10
wide = wide - 20

// Draw that mother
surface.DrawTexturedRect(x + (fsin), y - (fsin), wide - fsin * 2, (wide / 2) + (fsin))

// Draw weapon info box
self:PrintWeaponInfo(x + wide + 20, y + tall * 0.95, alpha)

end

/---------------------------------------------------------
Name: SWEP:PrintWeaponInfo()
Desc: Draws the weapon info box.
---------------------------------------------------------
/
function SWEP:PrintWeaponInfo(x, y, alpha)

if (self.DrawWeaponInfoBox == false) then return end

if (self.InfoMarkup == nil) then
	local str
	local title_color = "<color = 130, 0, 0, 255>"
	local text_color = "<color = 255, 255, 255, 200>"
	
	str = "<font=HudSelectionText>"
	if (self.Author != "") then str = str .. title_color .. "Author:</color>	" .. text_color .. self.Author .. "</color>

" end
if (self.Contact != “”) then str = str … title_color … "Contact:</color> " … text_color … self.Contact … "</color>

" end
if (self.Purpose != “”) then str = str … title_color … "Purpose:</color>
" … text_color … self.Purpose … "</color>

" end
if (self.Instructions!= “”) then str = str … title_color … "Instructions:</color>
" … text_color … self.Instructions … "</color>
" end
str = str … “</font>”

	self.InfoMarkup = markup.Parse(str, 250)
end

alpha = 180

surface.SetDrawColor(0, 0, 0, alpha)
surface.SetTexture(self.SpeechBubbleLid)

surface.DrawTexturedRect(x, y - 69.5, 128, 64) 
draw.RoundedBox(8, x - 5, y - 6, 260, self.InfoMarkup:GetHeight() + 18, Color(0, 0, 0, alpha))

self.InfoMarkup:Draw(x + 5, y + 5, nil, nil, alpha)

end

/---------------------------------------------------------
Name: SWEP:GetViewModelPosition()
Desc: Allows you to re-position the view model.
---------------------------------------------------------
/
local IRONSIGHT_TIME = 0.2

function SWEP:GetViewModelPosition(pos, ang)

local bIron = self.Weapon:GetDTBool(1)	

local DashDelta = 0

if (self.Owner:KeyDown(IN_SPEED)) and (self.Owner:GetVelocity():Length() &gt; self.Owner:GetWalkSpeed()) or self.Weapon:GetDTBool(0) then
	if (!self.DashStartTime) then
		self.DashStartTime = CurTime()
	end
	
	DashDelta = math.Clamp(((CurTime() - self.DashStartTime) / 0.1) ^ 1.2, 0, 1)
else
	if (self.DashStartTime) then
		self.DashEndTime = CurTime()
	end

	if (self.DashEndTime) then
		DashDelta = math.Clamp(((CurTime() - self.DashEndTime) / 0.1) ^ 1.2, 0, 1)
		DashDelta = 1 - DashDelta
		if (DashDelta == 0) then self.DashEndTime = nil end
	end

	self.DashStartTime = nil
end

if (DashDelta) then
	local Down = ang:Up() * -1
	local Right = ang:Right()
	local Forward = ang:Forward()

	local bUseVector = false
	
	if(!self.RunArmAngle.pitch) then
		bUseVector = true
	end
	
	if (bUseVector == true) then
		ang:RotateAroundAxis(ang:Right(), self.RunArmAngle.x * DashDelta)
		ang:RotateAroundAxis(ang:Up(), self.RunArmAngle.y * DashDelta)
		ang:RotateAroundAxis(ang:Forward(), self.RunArmAngle.z * DashDelta)
		
		pos = pos + self.RunArmOffset.x * ang:Right() * DashDelta 
		pos = pos + self.RunArmOffset.y * ang:Forward() * DashDelta 
		pos = pos + self.RunArmOffset.z * ang:Up() * DashDelta 
	else
		ang:RotateAroundAxis(Right, elf.RunArmAngle.pitch * DashDelta)
		ang:RotateAroundAxis(Down, self.RunArmAngle.yaw * DashDelta)
		ang:RotateAroundAxis(Forward, self.RunArmAngle.roll * DashDelta)

		pos = pos + (Down * self.RunArmOffset.x + Forward * self.RunArmOffset.y + Right * self.RunArmOffset.z) * DashDelta			
	end
	
	if (self.DashEndTime) then
		return pos, ang
	end
end

if (bIron != self.bLastIron) then
	self.bLastIron = bIron 
	self.fIronTime = CurTime()
	
	if (bIron) then 
		self.SwayScale 	= 0.1
		self.BobScale 	= 0.1
	else 
		self.SwayScale 	= 1.0
		self.BobScale 	= 1.0
	end

end

local fIronTime = self.fIronTime or 0

if (!bIron && fIronTime &lt; CurTime() - IRONSIGHT_TIME) then 
	return pos, ang
end

local Mul = 1.0

if (fIronTime &gt; CurTime() - IRONSIGHT_TIME) then
	Mul = math.Clamp((CurTime() - fIronTime) / IRONSIGHT_TIME, 0, 1)

	if (!bIron) then Mul = 1 - Mul end
end

if (self.IronSightsAng) then
	ang = ang * 1
	ang:RotateAroundAxis(ang:Right(), 	self.IronSightsAng.x * Mul)
	ang:RotateAroundAxis(ang:Up(), 	self.IronSightsAng.y * Mul)
	ang:RotateAroundAxis(ang:Forward(), self.IronSightsAng.z * Mul)
end

local Right 	= ang:Right()
local Up 		= ang:Up()
local Forward 	= ang:Forward()

pos = pos + self.IronSightsPos.x * Right * Mul
pos = pos + self.IronSightsPos.y * Forward * Mul
pos = pos + self.IronSightsPos.z * Up * Mul

return pos, ang

end

/---------------------------------------------------------
Name: SWEP:AdjustMouseSensitivity()
Desc: Allows you to adjust the mouse sensitivity.
---------------------------------------------------------
/
function SWEP:AdjustMouseSensitivity()

return nil

end

/---------------------------------------------------------
Name: SWEP:GetTracerOrigin()
Desc: Allows you to override where the tracer comes from (in first person view)
returning anything but a vector indicates that you want the default action.
---------------------------------------------------------
/
function SWEP:GetTracerOrigin()

if (self.Weapon:GetDTBool(1)) then
	local pos = self:GetOwner():EyePos() + self:GetOwner():EyeAngles():Up() * -4
	return pos
end

end
[/lua]
Line 79 has a “crosshairaccuracy” is a nil value.
Line 213 has “runarmangle” nil value.
These errors don’t make sense, if they work the exact way they did before, then what’s wrong now?
More examples;
[lua]
include(‘shared.lua’)

SWEP.PrintName = “Sims Weapon Sniper Base” // ‘Nice’ Weapon name (Shown on HUD)
SWEP.Slot = 3 // Slot in the weapon selection menu
SWEP.SlotPos = 1 // Position in the slot

/---------------------------------------------------------
Name: SWEP:DrawHUD()
---------------------------------------------------------
/
local iScreenWidth = surface.ScreenWidth()
local iScreenHeight = surface.ScreenHeight()

local SCOPEFADE_TIME = 0.4

function SWEP:DrawHUD()

self:SecondDrawHUD()
self:DrawFuelHUD()

if (self.Sniper) then

	local bScope = self.Weapon:GetDTBool(2)

	if bScope ~= self.bLastScope then // Are we turning the scope off/on?
		self.bLastScope = bScope
		self.fScopeTime = CurTime()
	elseif bScope then
		local fScopeZoom = self.Weapon:GetNetworkedFloat("ScopeZoom")

		if fScopeZoom ~= self.fLastScopeZoom then // Are we changing the scope zoom level?
	
			self.fLastScopeZoom = fScopeZoom
			self.fScopeTime = CurTime()
		end
	end
		
	local fScopeTime = self.fScopeTime or 0

	if fScopeTime &gt; CurTime() - SCOPEFADE_TIME then
	
		local Mul = 1.0 -- This scales the alpha
		Mul = 1 - math.Clamp((CurTime() - fScopeTime) / SCOPEFADE_TIME, 0, 1)
	
		surface.SetDrawColor(0, 0, 0, 255 * Mul) // Draw a black rect over everything and scale the alpha for a neat fadein effect
		surface.DrawRect(0, 0, iScreenWidth,iScreenHeight)
	end

	if (bScope) then 

		// Draw the crosshair
		if not (self.RedDot) then
			surface.SetDrawColor(0, 0, 0, 255)
			surface.DrawLine(self.CrossHairTable.x11, self.CrossHairTable.y11, self.CrossHairTable.x12, self.CrossHairTable.y12)
			surface.DrawLine(self.CrossHairTable.x21, self.CrossHairTable.y21, self.CrossHairTable.x22, self.CrossHairTable.y22)
		end

		// Put the texture
		surface.SetDrawColor(0, 0, 0, 255)

		if (self.RedDot) then
			surface.SetTexture(surface.GetTextureID("scope/scope_lens"))
		else
			surface.SetTexture(surface.GetTextureID("scope/scope_normal"))
		end

		surface.DrawTexturedRect(self.LensTable.x, self.LensTable.y, self.LensTable.w, self.LensTable.h)

		// Fill in everything else
		surface.SetDrawColor(0, 0, 0, 255)
		surface.DrawRect(self.QuadTable.x1 - 2.5, self.QuadTable.y1 - 2.5, self.QuadTable.w1 + 5, self.QuadTable.h1 + 5)
		surface.DrawRect(self.QuadTable.x2 - 2.5, self.QuadTable.y2 - 2.5, self.QuadTable.w2 + 5, self.QuadTable.h2 + 5)
		surface.DrawRect(self.QuadTable.x3 - 2.5, self.QuadTable.y3 - 2.5, self.QuadTable.w3 + 5, self.QuadTable.h3 + 5)
		surface.DrawRect(self.QuadTable.x4 - 2.5, self.QuadTable.y4 - 2.5, self.QuadTable.w4 + 5, self.QuadTable.h4 + 5)
	end
end

if (self.Weapon:GetDTBool(1) and not self.Weapon:GetNetworkedBool("Suppressor")) or (cl_crosshair_t:GetBool() == false) or (LocalPlayer():InVehicle()) then return end

local hitpos = util.TraceLine ({
	start = LocalPlayer():GetShootPos(),
	endpos = LocalPlayer():GetShootPos() + LocalPlayer():GetAimVector() * 4096,
	filter = LocalPlayer(),
	mask = MASK_SHOT
}).HitPos

local screenpos = hitpos:ToScreen()

local x = screenpos.x
local y = screenpos.y

if self.Primary.Cone &lt; 0.005 then
	self.Primary.Cone = 0.005
end

local gap = ((self.Primary.Cone * 275) + (((self.Primary.Cone * 275) * (ScrH() / 720))) * (1 / self:CrosshairAccuracy())) * 0.75

gap = math.Clamp(gap, 0, (ScrH() / 2) - 100)
local length = cl_crosshair_l:GetInt()

self:DrawCrosshairHUD(x - gap - length, y - 1, length, 3) 	// Left
self:DrawCrosshairHUD(x + gap + 1, y - 1, length, 3) 		// Right
self:DrawCrosshairHUD(x - 1, y - gap - length, 3, length) 	// Top 
self:DrawCrosshairHUD(x - 1, y + gap + 1, 3, length) 		// Bottom

end

/---------------------------------------------------------
Name: SWEP:TranslateFOV()
---------------------------------------------------------
/
local IRONSIGHT_TIME = 0.2

function SWEP:TranslateFOV(current_fov)

local fScopeZoom = self.Weapon:GetNetworkedFloat("ScopeZoom")

if self.Weapon:GetDTBool(2) then return current_fov / fScopeZoom end

local bIron = self.Weapon:GetDTBool(1)

if bIron ~= self.bLastIron then // Do the same thing as in CalcViewModel. I don't know why this works, but it does.
	self.bLastIron = bIron 
	self.fIronTime = CurTime()
end

local fIronTime = self.fIronTime or 0

if not bIron and (fIronTime &lt; CurTime() - IRONSIGHT_TIME) then 
	return current_fov
end

local Mul = 1.0 // More interpolating shit

if fIronTime &gt; CurTime() - IRONSIGHT_TIME then
	Mul = math.Clamp((CurTime() - fIronTime) / IRONSIGHT_TIME, 0, 1)
	if not bIron then Mul = 1 - Mul end
end

current_fov = current_fov*(1 + Mul/self.IronSightZoom - Mul)

return current_fov

end

/---------------------------------------------------------
Name: SWEP:GetTracerOrigin()
Desc: Allows you to override where the tracer comes from (in first person view)
returning anything but a vector indicates that you want the default action.
---------------------------------------------------------
/
function SWEP:GetTracerOrigin()

if (self.Weapon:GetDTBool(1)) then
	local pos = self:GetOwner():EyePos() + self:GetOwner():EyeAngles():Up() * -5
	return pos
end

end

/---------------------------------------------------------
Name: SniperCreateMove()
---------------------------------------------------------
/
local staggerdir = VectorRand():Normalize()

local function SniperCreateMove(cmd)

if (LocalPlayer():GetActiveWeapon():IsValid() and LocalPlayer():GetActiveWeapon():GetDTBool(2)) then
	local ang = cmd:GetViewAngles()

	local ft = FrameTime()

	ang.pitch = math.NormalizeAngle(ang.pitch + staggerdir.z * ft * 1)
	ang.yaw = math.NormalizeAngle(ang.yaw + staggerdir.x * ft * 1)

	staggerdir = (staggerdir + ft * 10 * VectorRand()):Normalize()

	cmd:SetViewAngles(ang)	
end

end
hook.Add (“CreateMove”, “SniperCreateMove”, SniperCreateMove)
[/lua]
Line 137 “ironsightzoom” is a nil value.
Line 95 “crosshairaccuracy” is a nil value.
I could really use some help, thank you all in advance.

Also, a swep example;
[lua]

SWEP.ViewModelFOV = 70
SWEP.Base = “weapon_dod_sim_base”
SWEP.ViewModelFlip = true
SWEP.HoldType = “ar2”
SWEP.Spawnable = true
SWEP.AdminSpawnable = false

SWEP.ViewModel = “models/weapons/v_smg_***.mdl”
SWEP.WorldModel = “models/weapons/w_fists_t.mdl”

SWEP.Weight = 5
SWEP.AutoSwitchTo = true
SWEP.AutoSwitchFrom = true

SWEP.Primary.Sound = Sound(“weapons/***/shot-”…math.random(1,2)…".wav")
SWEP.Primary.Recoil = 2.8
SWEP.Primary.Damage = 47
SWEP.Primary.NumShots = 1
SWEP.Primary.Cone = 0.014
SWEP.Primary.ClipSize = 20
SWEP.Primary.Delay = 0.10909090909090909090909090909091
SWEP.Primary.DefaultClip = 0
SWEP.Primary.Automatic = true
SWEP.Primary.Ammo = “GaussEnergy”

SWEP.ShellEffect = “sim_shelleject_fas_762x51”

SWEP.ShellDelay = 0.03
SWEP.DeployDelay = 1.25
SWEP.Pistol = false
SWEP.Rifle = true
SWEP.Shotgun = false
SWEP.Sniper = false

SWEP.Secondary.ClipSize = -1
SWEP.Secondary.DefaultClip = -1
SWEP.Secondary.Automatic = false
SWEP.Secondary.Ammo = “none”
SWEP.IronSightsPos = Vector(2.059, -6.722, -0.033)
SWEP.IronSightsAng = Vector(0, -0.051, 0)
SWEP.RunArmOffset = Vector (2.3341, 0, 3.5457)
SWEP.RunArmAngle = Vector (-15.4971, 14.8831, 0)

// Custom mode options (Do not put a burst mode and a custom mode at the same time, it will not work)
SWEP.Type = 1 // 1 = Automatic/Semi-Automatic mode, 2 = Suppressor mode, 3 = Burst fire mode
SWEP.Mode = true

SWEP.data = {}
SWEP.data.NormalMsg = “Switched to Automatic”
SWEP.data.ModeMsg = “Switched to Semi-Automatic.”
SWEP.data.Delay = 1 // You need to wait 0.5 second after you change the fire mode
SWEP.data.Cone = 0.9

/---------------------------------------------------------
Name: SWEP:Precache()
Desc: Use this function to precache stuff.
---------------------------------------------------------
/
function SWEP:Precache()

	util.PrecacheSound("weapons/garand_shoot.wav")

end

/---------------------------------------------------------
Name: SWEP:SetMode()
---------------------------------------------------------
/
function SWEP:SetMode(b)

if (self.Owner) then
	if (b) then
		if self.Type == 1 then
			self.Weapon:SendWeaponAnim(ACT_VM_DEPLOY)
		end

		if (SERVER) then
			self.Owner:PrintMessage(HUD_PRINTTALK, self.data.ModeMsg)
		end
	else
		if self.Type == 1 then
			self.Weapon:SendWeaponAnim(ACT_VM_UNDEPLOY)
		end

		if (SERVER) then
			self.Owner:PrintMessage(HUD_PRINTTALK, self.data.NormalMsg)
		end
	end
end

if (self.Weapon) then
	self.Weapon:SetDTBool(3, b)
end

end

/---------------------------------------------------------
Name: SWEP:ReloadAnimation()
---------------------------------------------------------
/
function SWEP:ReloadAnimation()

// Reload with the suppressor animation if you're suppressor is on the FUCKING gun
if self.Weapon:GetDTBool(3) and self.Type == 3 then
	self.Weapon:DefaultReload(ACT_VM_RELOAD)
else
	self.Weapon:DefaultReload(ACT_VM_RELOAD)
end

if (IsValid(self.Owner) and self.Owner:GetViewModel()) then
	self:IdleAnimation(self.Owner:GetViewModel():SequenceDuration())
end

end

/---------------------------------------------------------
Name: SWEP:SetIronsights()
---------------------------------------------------------
/
function SWEP:SetIronsights(b)

if (self.Owner) then
	if (b) then
		if (SERVER) then
			self.Owner:SetFOV(65, 0.2)
		end
		

		if self.AllowIdleAnimation then
			if self.Weapon:GetDTBool(3) and self.Type == 3 then
				self.Weapon:SendWeaponAnim(ACT_VM_IDLE)
			else
				self.Weapon:SendWeaponAnim(ACT_VM_IDLE)
			end

			self.Owner:GetViewModel():SetPlaybackRate(0)
		end

		self.Weapon:EmitSound("weapons/universal/iron_in.wav")
		self.Owner:SetRunSpeed(100)
		self.Owner:SetWalkSpeed(100)
	else
		if (SERVER) then
			self.Owner:SetFOV(0, 0.2)
		end

		if self.AllowPlaybackRate and self.AllowIdleAnimation then
			self.Owner:GetViewModel():SetPlaybackRate(1)
		end	

		self.Weapon:EmitSound("weapons/universal/iron_out.wav")
		self.Owner:SetRunSpeed(500)
		self.Owner:SetWalkSpeed(250)
	end
end

if (self.Weapon) then
	self.Weapon:SetDTBool(1, b)
end

end

/---------------------------------------------------------
Name: SWEP:SecondThink()
Desc: Called every frame. Use this function if you don’t
want to copy/past the think function everytime you
create a new weapon with this base…
---------------------------------------------------------
/
function SWEP:SecondThink()
end

/---------------------------------------------------------
Name: SWEP:DeployAnimation()
---------------------------------------------------------
/
function SWEP:DeployAnimation()

if self.Weapon:GetDTBool(3) and self.Type == 3 then
	self.Weapon:SendWeaponAnim(ACT_VM_DRAW)
else
	self.Weapon:SendWeaponAnim(ACT_VM_DRAW)
end

end

/---------------------------------------------------------
Name: SWEP:ShootAnimation()
---------------------------------------------------------
/
function SWEP:ShootAnimation()

if self.Weapon:GetDTBool(3) and self.Type == 3 then
		self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK) 	// View model animation
	else
		self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK) 		// View model animation
end

end

/---------------------------------------------------------
Name: SWEP:Think()
Desc: Called every frame.
---------------------------------------------------------
/
function SWEP:Think()

self:SecondThink()

if self.Weapon:Clip1() &gt; 0 and self.IdleDelay &lt; CurTime() and self.IdleApply then
	local WeaponModel = self.Weapon:GetOwner():GetActiveWeapon():GetClass()

	if self.Owner and self.Weapon:GetOwner():GetActiveWeapon():GetClass() == WeaponModel and self.Owner:Alive() then
		if self.Weapon:GetDTBool(3) and self.Type == 3 then
			self.Weapon:SendWeaponAnim(ACT_VM_IDLE)
		else
			self.Weapon:SendWeaponAnim(ACT_VM_IDLE)
		end
		

		if self.AllowPlaybackRate and not self.Weapon:GetDTBool(1) then
			self.Owner:GetViewModel():SetPlaybackRate(1)
		else
			self.Owner:GetViewModel():SetPlaybackRate(0)
		end		
	end

	self.IdleApply = false
elseif self.Weapon:Clip1() == 0 then
	self.IdleApply = false
end

if self.Weapon:GetDTBool(1) and self.Owner:KeyDown(IN_SPEED) then
	self:SetIronsights(false)
end

// If you're running or if your weapon is holsted, the third person animation is going to change
if self.Owner:KeyDown(IN_SPEED) or self.Weapon:GetDTBool(0) then
	if self.Rifle or self.Sniper or self.Shotgun then
		self:SetWeaponHoldType("passive")
	
	elseif self.Pistol then
		self:SetWeaponHoldType("normal")
	end
	
else
	self:SetWeaponHoldType(self.HoldType)
end

if self.Owner:KeyDown(IN_SPEED) or self.Weapon:GetDTBool(0) then return end

if (self.Owner:KeyDown(IN_USE)) then
	self:SetWeaponHoldType("fist")	
else
	self:SetWeaponHoldType(self.HoldType)
end	

self:NextThink(CurTime())

end

/---------------------------------------------------------
Name: SWEP:PrimaryAttack()
Desc: +attack1 has been pressed.
---------------------------------------------------------
/
function SWEP:PrimaryAttack()

if (not self.Owner:IsNPC() and not self.Owner:KeyDown(IN_SPEED) and self.Owner:KeyDown(IN_USE)) then
	
	if (SERVER) then
		bHolsted = !self.Weapon:GetDTBool(0)
		self:SetHolsted(bHolsted)
	end

	self.Weapon:SetNextPrimaryFire(CurTime() + 0.3)
	self.Weapon:SetNextSecondaryFire(CurTime() + 0.3)

	self:SetIronsights(false)

	return
end

if (not self:CanPrimaryAttack()) then return end

self.Reloadaftershoot = CurTime() + self.Primary.Delay
self.ActionDelay = (CurTime() + self.Primary.Delay + 0.05)
self.Weapon:SetNextPrimaryFire(CurTime() + self.Primary.Delay)
self.Weapon:SetNextSecondaryFire(CurTime() + self.Primary.Delay)

// If the burst mode is activated, it's going to shoot the three bullets (or more if you're dumb and put 4 or 5 bullets for your burst mode)
if self.Weapon:GetDTBool(3) and self.Type == 3 then
	self.BurstTimer 	= CurTime()
	self.BurstCounter = self.BurstShots - 1
	self.Weapon:SetNextPrimaryFire(CurTime() + 0.17142857142857142857142857142857)
end

self.Weapon:EmitSound(self.Primary.Sound)

self:TakePrimaryAmmo(1)

self:ShootBulletInformation()

end

function SWEP:Reload()

if (self.Owner:KeyDown(IN_USE)) then
	
	if self.Weapon:GetDTBool(0) or self.Owner:KeyDown(IN_SPEED) then return end
	self.Weapon:SetNextPrimaryFire(CurTime() + 3)
	self.Weapon:SetNextSecondaryFire(CurTime() + 3)

	if (SERVER) then
		
		local knife = ents.Create("sim_ent_BAR")
		knife:SetAngles(self.Owner:EyeAngles())

// if (self:GetIronsights() == false) then
local pos = self.Owner:GetShootPos()
pos = pos + self.Owner:GetForward() * 5
pos = pos + self.Owner:GetRight() * 9
pos = pos + self.Owner:GetUp() * -5
knife:SetPos(pos)
// else
// knife:SetPos (self.Owner:EyePos() + (self.Owner:GetAimVector()))
// end

		knife:Spawn()
		knife:Activate()

		local phys = knife:GetPhysicsObject()
		phys:SetVelocity(self.Owner:GetAimVector() * 100)
		phys:AddAngleVelocity(Vector(0, 0, 0))
		
		self.Owner:StripWeapon("weapon_sim_BAR")
		if (SERVER) then
			RunConsoleCommand("lastinv")
		end

	end
else

	// When the weapon is already doing an animation, just return end because we don't want to interrupt it
	if (self.ActionDelay &gt; CurTime()) then return end 
	
	if self.Owner:KeyDown(IN_SPEED) then return end

	if (SERVER) then
		if ( self.Reloadaftershoot &gt; CurTime() ) then return end 
	end

	// Need to call the default reload before the real reload animation
	self.Weapon:DefaultReload(ACT_VM_RELOAD)

	if (self.Weapon:Clip1() &lt; self.Primary.ClipSize) and (self.Owner:GetAmmoCount(self.Primary.Ammo) &gt; 0) then
		self:SetIronsights(false)
		self:ReloadAnimation()
	end
end

end

/**************************************************
SWEP Construction Kit base code
Created by Clavus
Available for public use, thread at:
facepunch.com/threads/1032378
**************************************************/

function SWEP:Initialize()

// other initialize code goes here

if CLIENT then

	self:CreateModels(self.VElements) // create viewmodels
	self:CreateModels(self.WElements) // create worldmodels
	
	// init view model bone build function
	self.BuildViewModelBones = function( s )
		if LocalPlayer():GetActiveWeapon() == self and self.ViewModelBoneMods then
			for k, v in pairs( self.ViewModelBoneMods ) do
				local bone = s:LookupBone(k)
				if (!bone) then continue end
				local m = s:GetBoneMatrix(bone)
				if (!m) then continue end
				m:Scale(v.scale)
				m:Rotate(v.angle)
				m:Translate(v.pos)
				s:SetBoneMatrix(bone, m)
			end
		end
	end
	
end

end

function SWEP:OnRemove()

// other onremove code goes here

if CLIENT then
	self:RemoveModels()
end

end

if CLIENT then

SWEP.vRenderOrder = nil
function SWEP:ViewModelDrawn()
	
	local vm = self.Owner:GetViewModel()
	if !ValidEntity(vm) then return end
	
	if (!self.VElements) then return end
	
	if vm.BuildBonePositions ~= self.BuildViewModelBones then
		vm.BuildBonePositions = self.BuildViewModelBones
	end

	if (self.ShowViewModel == nil or self.ShowViewModel) then
		vm:SetColor(255,255,255,255)
	else
		// we set the alpha to 1 instead of 0 because else ViewModelDrawn stops being called
		vm:SetColor(255,255,255,1) 
	end
	
	if (!self.vRenderOrder) then
		
		// we build a render order because sprites need to be drawn after models
		self.vRenderOrder = {}

		for k, v in pairs( self.VElements ) do
			if (v.type == "Model") then
				table.insert(self.vRenderOrder, 1, k)
			elseif (v.type == "Sprite" or v.type == "Quad") then
				table.insert(self.vRenderOrder, k)
			end
		end
		
	end

	for k, name in ipairs( self.vRenderOrder ) do
	
		local v = self.VElements[name]
		if (!v) then self.vRenderOrder = nil break end
	
		local model = v.modelEnt
		local sprite = v.spriteMaterial
		
		if (!v.bone) then continue end
		
		local pos, ang = self:GetBoneOrientation( self.VElements, v, vm )
		
		if (!pos) then continue end
		
		if (v.type == "Model" and ValidEntity(model)) then

			model:SetPos(pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z )
			ang:RotateAroundAxis(ang:Up(), v.angle.y)
			ang:RotateAroundAxis(ang:Right(), v.angle.p)
			ang:RotateAroundAxis(ang:Forward(), v.angle.r)

			model:SetAngles(ang)
			model:SetModelScale(v.size)
			
			if (v.material == "") then
				model:SetMaterial("")
			elseif (model:GetMaterial() != v.material) then
				model:SetMaterial( v.material )
			end
			
			if (v.skin and v.skin != model:GetSkin()) then
				model:SetSkin(v.skin)
			end
			
			if (v.bodygroup) then
				for k, v in pairs( v.bodygroup ) do
					if (model:GetBodygroup(k) != v) then
						model:SetBodygroup(k, v)
					end
				end
			end
			
			if (v.surpresslightning) then
				render.SuppressEngineLighting(true)
			end
			
			render.SetColorModulation(v.color.r/255, v.color.g/255, v.color.b/255)
			render.SetBlend(v.color.a/255)
			model:DrawModel()
			render.SetBlend(1)
			render.SetColorModulation(1, 1, 1)
			
			if (v.surpresslightning) then
				render.SuppressEngineLighting(false)
			end
			
		elseif (v.type == "Sprite" and sprite) then
			
			local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z
			render.SetMaterial(sprite)
			render.DrawSprite(drawpos, v.size.x, v.size.y, v.color)
			
		elseif (v.type == "Quad" and v.draw_func) then
			
			local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z
			ang:RotateAroundAxis(ang:Up(), v.angle.y)
			ang:RotateAroundAxis(ang:Right(), v.angle.p)
			ang:RotateAroundAxis(ang:Forward(), v.angle.r)
			
			cam.Start3D2D(drawpos, ang, v.size)
				v.draw_func( self )
			cam.End3D2D()

		end
		
	end
	
end

SWEP.wRenderOrder = nil
function SWEP:DrawWorldModel()
	
	if (self.ShowWorldModel == nil or self.ShowWorldModel) then
		self:DrawModel()
	end
	
	if (!self.WElements) then return end
	
	if (!self.wRenderOrder) then

		self.wRenderOrder = {}

		for k, v in pairs( self.WElements ) do
			if (v.type == "Model") then
				table.insert(self.wRenderOrder, 1, k)
			elseif (v.type == "Sprite" or v.type == "Quad") then
				table.insert(self.wRenderOrder, k)
			end
		end

	end
	
	if (ValidEntity(self.Owner)) then
		bone_ent = self.Owner
	else
		// when the weapon is dropped
		bone_ent = self
	end
	
	for k, name in pairs( self.wRenderOrder ) do
	
		local v = self.WElements[name]
		if (!v) then self.wRenderOrder = nil break end
		
		local pos, ang
		
		if (v.bone) then
			pos, ang = self:GetBoneOrientation( self.WElements, v, bone_ent )
		else
			pos, ang = self:GetBoneOrientation( self.WElements, v, bone_ent, "ValveBiped.Bip01_R_Hand" )
		end
		
		if (!pos) then continue end
		
		local model = v.modelEnt
		local sprite = v.spriteMaterial
		
		if (v.type == "Model" and ValidEntity(model)) then

			model:SetPos(pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z )
			ang:RotateAroundAxis(ang:Up(), v.angle.y)
			ang:RotateAroundAxis(ang:Right(), v.angle.p)
			ang:RotateAroundAxis(ang:Forward(), v.angle.r)

			model:SetAngles(ang)
			model:SetModelScale(v.size)
			
			if (v.material == "") then
				model:SetMaterial("")
			elseif (model:GetMaterial() != v.material) then
				model:SetMaterial( v.material )
			end
			
			if (v.skin and v.skin != model:GetSkin()) then
				model:SetSkin(v.skin)
			end
			
			if (v.bodygroup) then
				for k, v in pairs( v.bodygroup ) do
					if (model:GetBodygroup(k) != v) then
						model:SetBodygroup(k, v)
					end
				end
			end
			
			if (v.surpresslightning) then
				render.SuppressEngineLighting(true)
			end
			
			render.SetColorModulation(v.color.r/255, v.color.g/255, v.color.b/255)
			render.SetBlend(v.color.a/255)
			model:DrawModel()
			render.SetBlend(1)
			render.SetColorModulation(1, 1, 1)
			
			if (v.surpresslightning) then
				render.SuppressEngineLighting(false)
			end
			
		elseif (v.type == "Sprite" and sprite) then
			
			local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z
			render.SetMaterial(sprite)
			render.DrawSprite(drawpos, v.size.x, v.size.y, v.color)
			
		elseif (v.type == "Quad" and v.draw_func) then
			
			local drawpos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z
			ang:RotateAroundAxis(ang:Up(), v.angle.y)
			ang:RotateAroundAxis(ang:Right(), v.angle.p)
			ang:RotateAroundAxis(ang:Forward(), v.angle.r)
			
			cam.Start3D2D(drawpos, ang, v.size)
				v.draw_func( self )
			cam.End3D2D()

		end
		
	end
	
end

function SWEP:GetBoneOrientation( basetab, tab, ent, bone_override )
	
	local bone, pos, ang
	if (tab.rel and tab.rel != "") then
		
		local v = basetab[tab.rel]
		
		if (!v) then return end
		
		// Technically, if there exists an element with the same name as a bone
		// you can get in an infinite loop. Let's just hope nobody's that stupid.
		pos, ang = self:GetBoneOrientation( basetab, v, ent )
		
		if (!pos) then return end
		
		pos = pos + ang:Forward() * v.pos.x + ang:Right() * v.pos.y + ang:Up() * v.pos.z
		ang:RotateAroundAxis(ang:Up(), v.angle.y)
		ang:RotateAroundAxis(ang:Right(), v.angle.p)
		ang:RotateAroundAxis(ang:Forward(), v.angle.r)
			
	else
	
		bone = ent:LookupBone(bone_override or tab.bone)

		if (!bone) then return end
		
		pos, ang = Vector(0,0,0), Angle(0,0,0)
		local m = ent:GetBoneMatrix(bone)
		if (m) then
			pos, ang = m:GetTranslation(), m:GetAngle()
		end
		
		if (ValidEntity(self.Owner) and self.Owner:IsPlayer() and 
			ent == self.Owner:GetViewModel() and self.ViewModelFlip) then
			ang.r = -ang.r // Fixes mirrored models
		end
	
	end
	
	return pos, ang
end

function SWEP:CreateModels( tab )

	if (!tab) then return end

	// Create the clientside models here because Garry says we can't do it in the render hook
	for k, v in pairs( tab ) do
		if (v.type == "Model" and v.model and v.model != "" and (!ValidEntity(v.modelEnt) or v.createdModel != v.model) and 
				string.find(v.model, ".mdl") and file.Exists ("../"..v.model) ) then
			
			v.modelEnt = ClientsideModel(v.model, RENDER_GROUP_VIEW_MODEL_OPAQUE)
			if (ValidEntity(v.modelEnt)) then
				v.modelEnt:SetPos(self:GetPos())
				v.modelEnt:SetAngles(self:GetAngles())
				v.modelEnt:SetParent(self)
				v.modelEnt:SetNoDraw(true)
				v.createdModel = v.model
			else
				v.modelEnt = nil
			end
			
		elseif (v.type == "Sprite" and v.sprite and v.sprite != "" and (!v.spriteMaterial or v.createdSprite != v.sprite) 
			and file.Exists ("../materials/"..v.sprite..".vmt")) then
			
			local name = v.sprite.."-"
			local params = { ["$basetexture"] = v.sprite }
			// make sure we create a unique name based on the selected options
			local tocheck = { "nocull", "additive", "vertexalpha", "vertexcolor", "ignorez" }
			for i, j in pairs( tocheck ) do
				if (v[j]) then
					params["$"..j] = 1
					name = name.."1"
				else
					name = name.."0"
				end
			end

			v.createdSprite = v.sprite
			v.spriteMaterial = CreateMaterial(name,"UnlitGeneric",params)
			
		end
	end
	
end

function SWEP:OnRemove()
	self:RemoveModels()
end

function SWEP:RemoveModels()
	if (self.VElements) then
		for k, v in pairs( self.VElements ) do
			if (ValidEntity( v.modelEnt )) then v.modelEnt:Remove() end
		end
	end
	if (self.WElements) then
		for k, v in pairs( self.WElements ) do
			if (ValidEntity( v.modelEnt )) then v.modelEnt:Remove() end
		end
	end
	self.VElements = nil
	self.WElements = nil
end

end

SWEP.ShowViewModel = true
SWEP.ShowWorldModel = true
SWEP.ViewModelBoneMods = {}

SWEP.VElements = {
["***"] = { type = “Model”, model = “models/ddok1994/bodygroup/scarl.mdl”, bone = "Gun ", rel = “”, pos = Vector(4.074, -7.106, -8.179), angle = Angle(0, 90, 0), size = Vector(1.049, 1.1, 1.049), color = Color(255, 255, 255, 255), surpresslightning = false, material = “”, skin = 0, bodygroup = {[3] = 1, [6] = 1} },
[“mag”] = { type = “Model”, model = “models/ddok1994/bodygroup/scarl_mag.mdl”, bone = “magazine”, rel = “”, pos = Vector(4.169, -7.35, -13.855), angle = Angle(6, 90, 0), size = Vector(1.049, 1, 1), color = Color(255, 255, 255, 255), surpresslightning = false, material = “”, skin = 0, bodygroup = {} }
}

SWEP.WElements = {
["***"] = { type = “Model”, model = “models/ddok1994/bodygroup/scarl.mdl”, bone = “ValveBiped.Bip01_R_Hand”, rel = “”, pos = Vector(-1.07, 0.1, 0.824), angle = Angle(-0.65, 0.474, 180), size = Vector(1, 1, 1), color = Color(255, 255, 255, 255), surpresslightning = false, material = “”, skin = 0, bodygroup = {[3] = 1} }
}
[/lua]
Line 335, compared to nil value

please use “[lua]” tags

tell is which line has errors.

Forgot about those tags, cheanged them.
Also added the last script’s errors.

Your code isnt complete. You must define RunArmAngle (line 213-228) and CrosshairAccuracy() ( line 79).

Because what ever is defining them is including or sending the values to that specific location, and not to the one you are changing it to.

Fixed some things, they seem to work, I’ll continue posting what I need help with here, if people are supportive and want to help go right ahead.
[lua]
function SWEP:ReloadAnimation()

self.Weapon:DefaultReload(ACT_VM_RELOAD)
self.Weapon:EmitSound local reloadsounds
if (IsValid(self.Owner) and self.Owner:GetViewModel()) then
	self:IdleAnimation(self.Owner:GetViewModel():SequenceDuration())
end

end
[/lua]
What should I do to line 4? it says there’s a missing or incorrect symbol near “local”

That’s like doing
[lua]function Think() local herpderp = ilikepie[/lua] in the same line.

self.Weapon:EmitSound(reloadsounds)

That’s the proper call. Arguments go inside the parentheses when calling any function.

Here’s a line that’s been bothering me.
[lua]
function SWEP:Think()

self:SecondThink()

if self.Weapon:Clip1() &gt; 0 and self.IdleDelay &lt; CurTime() and self.IdleApply then
	local WeaponModel = self.Weapon:GetOwner():GetActiveWeapon():GetClass()

	if self.Owner and self.Weapon:GetOwner():GetActiveWeapon():GetClass() == WeaponModel and self.Owner:Alive() then
		if self.Weapon:GetDTBool(3) and self.Type == 3 then
			self.Weapon:SendWeaponAnim(ACT_VM_IDLE_SILENCED)
		else
			self.Weapon:SendWeaponAnim(ACT_VM_IDLE)
		end
		

		if self.AllowPlaybackRate and not self.Weapon:GetDTBool(1) then
			self.Owner:GetViewModel():SetPlaybackRate(1)
		else
			self.Owner:GetViewModel():SetPlaybackRate(0)
		end		
	end

	self.IdleApply = false
elseif self.Weapon:Clip1() == 0 then
	self.IdleApply = false
end

if self.Weapon:GetDTBool(1) and self.Owner:KeyDown(IN_SPEED) then
	self:SetIronsights(false)
end

if self.Owner:KeyDown(IN_SPEED) or self.Weapon:GetDTBool(0) then
	if self.Rifle or self.Sniper or self.Shotgun then
		self:SetWeaponHoldType("passive")
	
	elseif self.Pistol then
		self:SetWeaponHoldType("normal")
	end
	
else
	self:SetWeaponHoldType(self.HoldType)
end

if self.Owner:KeyDown(IN_SPEED) or self.Weapon:GetDTBool(0) then return end

if (self.Owner:KeyDown(IN_USE)) then
	self:SetWeaponHoldType("fist")	
else
	self:SetWeaponHoldType(self.HoldType)
end	

self:NextThink(CurTime())

end
[/lua]
Says the 5th line is nil, this is from a Child swep from the base. The same thing happens on all sweps using the base.

Try [lua] if self.Weapon:Clip1() > 0 and self.IdleDelay < CurTime() and self.IdleApply() then[/lua]

and make sure CurTime isn’t nil.