How can I resort my table and still use it?
I have the original coding here:
01 | local player = game.Players.LocalPlayer |
02 | local slots = script.Parent.Background.Tool.Slots:GetChildren() |
05 | for i, v in pairs (slots) do |
07 | table.insert(resorted, tostring (v)) |
10 | print (table.concat(resorted, ' ' )) |
12 | player.Inventory.ChildAdded:connect( function (obj) |
13 | if obj.ItemType.Value = = 2 then |
14 | for i, slots in pairs (resorted) do |
15 | if slots.Image = = "" then |
16 | local find = game.ReplicatedStorage.InvenFrames.Tools:FindFirstChild(obj.Name) |
17 | slots.Image = find.Image |
18 | slots.ItemName.Value = obj.Name |
19 | for i, clone in pairs (find:GetChildren()) do |
20 | if clone:IsA( "Folder" ) then |
But when I go back to use the newly sorted version, I can't. Any help?