Table returns nil instead of true

When I run this script, it returns nil instead of true

image = {}
for x = 1,16 do
	for y = 1,16 do
		image[x] = {}
		image[x][y] = true
	end
end

print(image[1][2])
  1. List item

Each y iteration, you’re setting image[x] back to an empty table. Instead, try putting image[x] = {} inside of the x iteration.

how did I not realize that, lol

rip 2 hours

1 Like