the error is in the title. the error occurs on the line 'print('the hmi is: '..hmi.Value..'the children: '..children[hmi.Value - 1].name)' (line 8)

if you need an explanation or something ill edit it

hmi.Changed:connect(function()
	print('The hmi is now ' .. hmi.Value)
	local lasthmi = hmi.Value - 1
	if hmi.Value > 1 then
		local children = scrollingframe:GetChildren()
		local newitem = scrollingframe.Item1:Clone()
		newitem.Name = 'Item'..hmi.Value 
		print('the hmi is: '..hmi.Value..'the children: '..children[hmi.Value - 1].name)
	end
end)

--EDIT: info about the hmi value: 'HMI is a numbervalue which sees how many children the players backpack has, i need this value -1 because every time it goes up a new frame in a gui is created and i need the last frames position to update it for the next (make it plus (0,0,0.002,0)) ------- hopefully that makes some sense'

7 comments

0

That error means that you are trying to index a nil value. I am not really good at scripting but I think that the [hmi.Value - 1] has no value in it.

0

means hmi is nil, or if hmi is an objectvalue means its value is nil. More info on hmi please?

0

im sorry it was my own foult i found it out myself i made a dumb mistake

0

it still doesn't work nevermind

0

HMI is a numbervalue which sees how many children the players backpack has, i need this value -1 because every time it goes up a new frame in a gui is created and i need the last frames position to update it for the next (make it plus (0,0,0.002,0)) ------- hopefully that makes some sense

0

.name's "N" is lowercase, change it to .Name, remember that lua is case sensative

0

that is the only discrepancy i could find, since any numbervalue's value is never nil