How could I use this table?

I am trying to make a supply box that supplies appearance changes depending on how much supply is inside and I am trying to automate the process easily.

What I want to do is search for when SupplyInside is larger than the number value (Example: 3) and when it is, make the part that matches the text (Example: “LowMed”) visible.

Script (right now):

local sizeFolder = script.Parent
local supplyInside = sizeFolder.Parent.SupplyInside

local sizeList = {
	
	{1, "Low"},
	{3, "LowMed"},
	{5, "Med"},
	{7.5, "MedHigh"},
	{10, "High"},
	{15, "Max"}
	
}

while wait() do
	
	if supplyInside.Value == 0 then
		for i, sizeParts in pairs(sizeFolder:GetChildren()) do
			if sizeParts:IsA("MeshPart") then
				sizeParts.Transparency = 1
			end
		end
	end
end

First off,

while wait() do
	
	if supplyInside.Value == 1 then
		for i, sizeParts in pairs(sizeFolder:GetChildren()) do
			if sizeParts:IsA("MeshPart") then
				sizeParts.Size = 1
			end
		end
	end

It is unclear of the objective here but this should work

What I would first do, is change your table structure. From what it is now, to this:

local sizeList = {
    [1] = "Low",
    [3] = "LowMed",
    [5] = "Med",
    [7.5] = "MedHigh",
    [10] = "High",
    [15] = "Max",
}

Now it’s a bit easier to use / index.

You can detect when supplyInside is larger than the number value whenever it’s value changes:

supplyInside.Changed:Connect(function()
    local supplyValue = supplyInside.Value
    if supplyValue > Some_Number then
        local thing = sizeList[supplyValue]
    end
end)

Another thing I would do is move this block of code right here:

if supplyInside.Value == 0 then
    for i, sizeParts in pairs(sizeFolder:GetChildren()) do
        if sizeParts:IsA("MeshPart") then
            sizeParts.Transparency = 1
        end
    end
end

Into the same event that I created in the earlier block of code, and remove the while wait() do end loop. This is because using while wait do loops is generally | bad | practice. And because the event would respond quicker to changes made to the supplyInside value if it were inside of an event.

So, it should now look like this:

supplyInside.Changed:Connect(function()
    local supplyValue = supplyInside.Value
    if supplyValue == 0 then
        for i, sizeParts in pairs(sizeFolder:GetChildren()) do
            if sizeParts:IsA("MeshPart") then
                sizeParts.Transparency = 1
            end
        end
    end
    if supplyValue > Some_Number then
        local thing = sizeList[supplyValue]
    end
end)

And in case you didn’t read, please delete the while wait() do loop for the reasons explained above.

There isn’t enough information given to understand how to accomplish this exactly. Where is the part list? I assume it’s right here local sizeFolder = script.Parent. But I don’t have any information about these parts. How are we supposed to know what part is associated with what text? Also, do you want to use the Some_Number value to index the sizeList table? Or do you want to use the value of supplyInside.Value / or supplyValue to index the table? Again, the objective here is very unclear.