yeah, here
local tablee = {"cup", "plate", "pencil", "notepad"}
table.remove(tablee, 2)
print(table[2])
if you mean the full thing of what i’m trying to do, here it is so far (plus some screenshots from explorer for some context JUST in case)
the script i’m working in is itemhandler

i think the only part of the script that would be necessary though is chara.ChildRemoved:Connect’s function, but just in case here’s everything:
local itemmenu = script.Parent:WaitForChild("items")
local labelbase = itemmenu:WaitForChild("itembase")
local player = game:GetService("Players").LocalPlayer
local chara = player.Character or player.CharacterAdded:Wait() -- put in a way to listen for when the character reloads
local inv = player:WaitForChild("Backpack")
local spacing = 8 -- spacing between list of items
local function insertitem(item, storagenumb)
item:SetAttribute("itemindex", storagenumb + 1)
itemmenu:SetAttribute("items", storagenumb + 1)
local h = labelbase:Clone()
h.Name = tostring(storagenumb + 1)
h.Position = UDim2.new(h.Position.X.Scale, h.Position.X.Offset, 0, 25 + (25*storagenumb) + (spacing*storagenumb))
h.Text = item.Name
h.Visible = true
local objvalue = Instance.new("ObjectValue") -- for when the menu calls to use the item, in case there is multiple of said item
objvalue.Name = "itemmenu_index"
objvalue.Parent = h
objvalue.Value = item
h.Parent = itemmenu
end
inv.ChildAdded:Connect(function(item)
print("item added: "..item.Name)
local storage = itemmenu:GetAttribute("items")
local ordervalue = item:GetAttribute("itemindex") -- if it was in the inventory previously, where was it in the menu
if storage < 8 then
if not ordervalue then -- it was never in the menu before, so this must be a NEW item
insertitem(item, storage)
else -- otherwise, this has been in the inventory before...
local placeinmenu = itemmenu:FindFirstChild(tostring(ordervalue)) -- find where it should be in the menu
if not placeinmenu or placeinmenu.itemmenu_index.Value ~= item then --if the place in the menu doesn't exist OR it's not the same object, treat it as a new item
insertitem(item, storage)
else --otherwise, it was probably taken out, so let's just make the label for it white again
placeinmenu.TextColor3 = Color3.new(1, 1, 1)
end
end
else
--do something here later to remove the item from the backpack
end
end)
inv.ChildRemoved:Connect(function(item)
print("item removed: "..item.Name)
--assuming this item is being used, let's gray it out (maybe make it yellow...?)
local ordervalue = item:GetAttribute("itemindex")
local placeinmenu = itemmenu:FindFirstChild(tostring(ordervalue))
placeinmenu.TextColor3 = Color3.new(1, 1, 0)
end)
chara.ChildRemoved:Connect(function(item)
if item:IsA("Tool") and item.Parent ~= inv then -- is this a tool and is it being put back into the backpack? if not...
local storage = itemmenu:GetAttribute("items")
local ordervalue = item:GetAttribute("itemindex") -- where the tool was in the inventory
local placeinmenu = itemmenu:FindFirstChild(tostring(ordervalue))
local items = {}
for i, v in pairs(itemmenu:GetChildren()) do -- and let's get a count of what's currently in the menu!
if tonumber(v.Name) then -- just to make sure this is storing an item and is not the use, drop or info options...
items[v.Name] = v -- let's put it in!
end
end
table.sort(items, function(a, b) -- sort by lowest to highest
return a[2] < b[2] -- if a is smaller than b, a goes first
end)
placeinmenu:Destroy() -- destroy the place in the menu it was in...
table.remove(items, ordervalue)
for i, v in pairs(items) do --lets re-organize the menu now that we removed the old item!
v.Name = i
v.Position = UDim2.new(v.Position.X.Scale, v.Position.X.Offset, 0, 25 + (25*(i-1)) + (spacing*(i-1)))
end
itemmenu:SetAttribute("items", storage - 1)
end
end)