Hey guys,
I'm trying to keep my t table constantly updated with the names of local slots (the names of slots are numbers from 1-4). I'm trying to constantly update the table only with names of slots inside which the User.Value == false otherwise don't include the name in the table if the User.Value == true. I hope you understand what I am trying to achieve, if not - Please feel free to ask me any question in the comments below this post.
My hierarchy: http://i.imgur.com/qExP1D1.png
My code:
while true do wait()
local t = {1, 2, 3, 4}
local slots = script.Parent.Parent.Slots:GetChildren()
local emptyslot = script.Parent.Value
for i,v in pairs(slots) do
if v.Used.Value == false then
table.insert(t,tonumber(v.Name))
number = (math.min(unpack(t)))
emptyslot = number
end
end
end

4 comments
I'm trying to: get all of slots and take their name, then put them in a table but only if the value slots.Used.Value == false, otherwise ignore it. This isn't working that way
That's exactly what it does. Maybe reconsider what you want then ask a better question
A bit of a weird situation, because the script doesn't error, but also doesn't function (?)
It is raw code. Either loop it or read what I said (put it in a bigger script).