Can you just give me a basic explanation of what you’re trying to accomplish and how it currently works because I believe I can make your system much more efficient and easy to work with
Is the players inventory stored as a table? As in a module script contains every players inventory, or is the inventory a set of objects in a folder?
local PlayersInventory = InventoryCheck:InvokeServer() -- this would equal the table above
Then I setup their inventory UI like so
local function Setup()
for i, v in pairs(PlayersInventory.Main) do
if v.Type then
local Slot = MainSlots:FindFirstChild(i)
if Slot then
local InventoryDefaultData = InventoryData[v.Type][v.Name]
Slot.Holder.Item.Value = Items[v.Type][v.Name]
Slot.Holder.Icon.Image = InventoryDefaultData.Image
if v.Quantity then
Slot.Holder.Quantity.Text = v.Quantity
end
if v.Durability then
UpdateDurabilityBar(true, Slot.Holder, v.Durability, InventoryDefaultData)
else
UpdateDurabilityBar(false, Slot.Holder)
end
end
end
end
end
-- LocalScript under StarterCharacterScripts
script.Parent.ChildAdded:Connect(function(child)
if child:IsA("Tool") then
local valid = SomeRemote:InvokeServer(child)
if not valid then child:Destroy()
end
end)
Nevermind. I still need a way of storing them on the client as object values ://// ran into problems where if you have multiples of the same item it doesn’t know which item to take durability etc. from. So it needs to have an actual object assigned to each slot, so it knows
I’m not sure but I think it would be better to store players inventory in Server Storage, as it is not able to be accessed locally, but then again I’m not sure as I’m fairly new to scripting.