Getting an error with gun code

So im working on fixing some guns for a game im working on with some other people, and i cant figure out how to fix this error:

ServerScriptService.SimulateBulletScript:11: invalid argument #1 to ‘pairs’ (table expected, got boolean)

This is the code

local function compareTables(arr1, arr2)
	for i, v in pairs(arr1) do
		if (typeof(v) == "table") then
			if (compareTables(arr2[i], v) == false) then
				return false
			end
		else
			if (v ~= arr2[i]) then
				return false
			end
		end
	end
	return true
end

What is arr1? You’re sending a bool value instead of a table and attempting to loop through it using a for loop.

1 Like