```lua
function SWEP:PrimaryAttack()
	OkaySoFar = true
	if not IsValid(self) then
		OkaySoFar = false
	else
		if not IsValid(self.Weapon) then
			OkaySoFar = false
		else
			if not IsValid(self:GetOwner()) then OkaySoFar = false end
		end
	end

	if not OkaySoFar then return end
	if self:CanPrimaryAttack() and self:GetOwner():IsPlayer() then
		if not self:GetOwner():KeyDown(IN_SPEED) and not self:GetOwner():KeyDown(IN_RELOAD) then
			self:ShootBulletInformation()
			self.Weapon:TakePrimaryAmmo(1)
			if self.Silenced then
				self.Weapon:SendWeaponAnim(self:Clip1() > 0 and ACT_VM_PRIMARYATTACK_SILENCED or ACT_VM_DRYFIRE_SILENCED)
				self.Weapon:EmitSound(self.Primary.SilencedSound)
			else
				self.Weapon:SendWeaponAnim(self:Clip1() > 0 and ACT_VM_PRIMARYATTACK or ACT_VM_DRYFIRE)
				self.Weapon:EmitSound(self.Primary.Sound)
			end

			local fx = EffectData()
			fx:SetEntity(self.Weapon)
			fx:SetOrigin(self:GetOwner():GetShootPos())
			fx:SetNormal(self:GetOwner():GetAimVector())
			fx:SetAttachment(self.MuzzleAttachment)
			if GetConVar("M9KGasEffect") ~= nil then if GetConVar("M9KGasEffect"):GetBool() then util.Effect("m9k_rg_muzzle_rifle", fx) end end
			self:GetOwner():SetAnimation(PLAYER_ATTACK1)
			self:GetOwner():MuzzleFlash()
			self.Weapon:SetNextPrimaryFire(CurTime() + 1 / (self.Primary.RPM / 60))
			self:CheckWeaponsAndAmmo()
			self.RicochetCoin = math.random(1, 4)
			if self.BoltAction then self:BoltBack() end
		end
	elseif self:CanPrimaryAttack() and self:GetOwner():IsNPC() then
		self:ShootBulletInformation()
		self.Weapon:TakePrimaryAmmo(1)
		self.Weapon:SendWeaponAnim(ACT_VM_PRIMARYATTACK)
		self.Weapon:EmitSound(self.Primary.Sound)
		self:GetOwner():SetAnimation(PLAYER_ATTACK1)
		self:GetOwner():MuzzleFlash()
		self.Weapon:SetNextPrimaryFire(CurTime() + 1 / (self.Primary.RPM / 60))
		self.RicochetCoin = math.random(1, 4)
	end
end
```
[{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "'self.Weapon' is the same as just 'self' in SWEPs",
	"startLineNumber": 189,
	"startColumn": 18,
	"endLineNumber": 189,
	"endColumn": 22
},{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "'self.Weapon' is the same as just 'self' in SWEPs",
	"startLineNumber": 200,
	"startColumn": 4,
	"endLineNumber": 200,
	"endColumn": 8
},{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "'self.Weapon' is the same as just 'self' in SWEPs",
	"startLineNumber": 202,
	"startColumn": 5,
	"endLineNumber": 202,
	"endColumn": 9
},{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "'self.Weapon' is the same as just 'self' in SWEPs",
	"startLineNumber": 203,
	"startColumn": 5,
	"endLineNumber": 203,
	"endColumn": 9
},{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "'self.Weapon' is the same as just 'self' in SWEPs",
	"startLineNumber": 205,
	"startColumn": 5,
	"endLineNumber": 205,
	"endColumn": 9
},{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "'self.Weapon' is the same as just 'self' in SWEPs",
	"startLineNumber": 206,
	"startColumn": 5,
	"endLineNumber": 206,
	"endColumn": 9
},{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "'self.Weapon' is the same as just 'self' in SWEPs",
	"startLineNumber": 210,
	"startColumn": 17,
	"endLineNumber": 210,
	"endColumn": 21
},{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "Double if statement. Please combine the condition of this if statement with that of the outer if statement using `and`.",
	"startLineNumber": 214,
	"startColumn": 45,
	"endLineNumber": 214,
	"endColumn": 131
},{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "'self.Weapon' is the same as just 'self' in SWEPs",
	"startLineNumber": 217,
	"startColumn": 4,
	"endLineNumber": 217,
	"endColumn": 8
},{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "'self.Weapon' is the same as just 'self' in SWEPs",
	"startLineNumber": 224,
	"startColumn": 3,
	"endLineNumber": 224,
	"endColumn": 7
},{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "'self.Weapon' is the same as just 'self' in SWEPs",
	"startLineNumber": 225,
	"startColumn": 3,
	"endLineNumber": 225,
	"endColumn": 7
},{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "'self.Weapon' is the same as just 'self' in SWEPs",
	"startLineNumber": 226,
	"startColumn": 3,
	"endLineNumber": 226,
	"endColumn": 7
},{
	"resource": "/C:/Program Files (x86)/Steam/steamapps/workshop/content/4000/3359164986/bob_gs45/lua/weapons/bobs_bob_base/shared.lua",
	"owner": "glua",
	"severity": 4,
	"message": "'self.Weapon' is the same as just 'self' in SWEPs",
	"startLineNumber": 229,
	"startColumn": 3,
	"endLineNumber": 229,
	"endColumn": 7
}]