The loop is supposed to go through each value and then find the name of the value then put that in a text label, but it instead goes through one value two times while ignoring one.

for key, value in pairs(userData) do
	print(key, value)
	for i, d in pairs(value) do
		print(i, d)
		for i = 1, #slots do
			if slots[i]:IsA("ImageButton") then
				local slot = slots[i]
				slot.Amount.Text = value["Amount"]
				slot.Title.Text = value["Name"]
			end
		end
	end
end

How would I make it so that the loop goes through each value?

2 comments

0

But what is userData, value and slots?

0

userdata value is a dictionary, value is the value of the key in the dictionary, and slots is the parent of all the slots.