"void" randomly appears in a dictionary. What the hell is "void"?!

Hello! Recently I encountered a problem where, when I generate a dictionary, some of the values just become void. It is important to notice that the void value isn’t a string, as otherwise it would be printed with quotes around it.

Here’s the output (part of it):
image

Here’s the part of the code that generates values with indexes between 11 and 40:

for i = 1,carsCount.mutated do
	carIndex += 1
	print(carIndex) -- prints between 11 and 40
	local car = buildCar(carIndex)
	car.BrickColor = BrickColor.new("Bright red")
	car.Material = "Grass"

	local parent = getParents()
	brainScript.MutateBrain(i,parent,mutateScale.Value) -- This is the part that inserts the values
end

void means theres nothing there, turns out some moron at the roblox headquarters thought an empty spot in a table should be void instead of nil

if you want to check if a value is void you literally have to do:
local function nothing() return end
table[123] == nothing()

5 Likes