Provide an overview of:
-
What does the code do and what are you not satisfied with?
The code refreshes the customized inventory, since sometimes it goes like this
-
What potential improvements have you considered?
Not really much the code works fine yeah but my head tells me theres another cleaner way to do it -
How (specifically) do you want to improve the code?
I want to make it look more neat, I want to learn more, get tips on how to make the code look more reasonable
util.refresh = function()
local values = {}
for i = 1, 3, 1 do
for _, v in pairs(toolbar:GetChildren()) do
if v.Name == nameframe then
local tnv = v.ToolNumber.Value
if tnv == 1 then
v.Parent = nil
values[v.ToolNumber.Value] = v
else
if values[v.ToolNumber.Value-1] then
v.Parent = nil
values[v.ToolNumber.Value] = v
end
end
end
end
end
for _, v in pairs(values) do
v.Parent = toolbar
end
end
That’s the code I use, all I do is require(util).refresh() then it will organize my tools based on the number.
From
To this
Like I said, there’s no bugs or nothing wrong, just asking for any other way?