why im getting attempt to index 'pac' global (a nil value) (the : THIS CODE IS NOT MINE, My friend sent me this the error i get is this

[ERROR] gamemodes/santosrp/gamemode/sh_pacmodels.lua:137: attempt to index global 'pac' (a nil value)
  1. PlayerSwitchWeapon - gamemodes/santosrp/gamemode/sh_pacmodels.lua:137
   2. UpdatePlayers - gamemodes/santosrp/gamemode/sh_pacmodels.lua:169
    3. unknown - gamemodes/santosrp/gamemode/cl_init.lua:105

sh_pacmodels 137 is this

	function GM.PacModels:PlayerSwitchWeapon( pPlayer, entOldWep, entNewWep )
		if not pPlayer.AttachPACPart then
			pac.SetupENT( pPlayer ) --line 137
			pPlayer:SetPACDrawDistance( GetConVarNumber("srp_pac_drawrange") )
		end

		local invalid
		for slotName, _ in pairs( GAMEMODE.Inv.m_tblEquipmentSlots ) do
			item = GAMEMODE.Inv:GetItem( GAMEMODE.Player:GetSharedGameVar(pPlayer, "eq_slot_".. slotName, "") )
			if not item or not item.PacOutfit then continue end
			if not IsValid( entOldWep ) or not IsValid( entNewWep ) then continue end
			if item.EquipGiveClass == entOldWep:GetClass() or item.EquipGiveClass == entNewWep:GetClass() then
				invalid = true
				break
			end
		end

sh_pacmodels 169 is this

	function GM.PacModels:UpdatePlayers()
		if not self.m_intLastThink then self.m_intLastThink = CurTime() +0.1 end
		if self.m_intLastThink > CurTime() then return end
		self.m_intLastThink = CurTime() +0.1

		local ragdoll, item
		for k, v in pairs( player.GetAll() ) do
			--Track active weapon
			if not v.m_entLastActiveWeapon then
				v.m_entLastActiveWeapon = v:GetActiveWeapon()
			else
				if v:GetActiveWeapon() ~= v.m_entLastActiveWeapon then
					self:PlayerSwitchWeapon( v, v.m_entLastActiveWeapon, v:GetActiveWeapon() ) -- line 169
					v.m_entLastActiveWeapon = v:GetActiveWeapon()
				end
			end



thank you guyss


