Need help with built-In inventory system

I want to arrange the slots in the roblox built in inventory system to make it neater for the players, but i cant find a way to move the slots using a script. Eg. put sword in slot 1 and gun in slot 2

local toolTable = {}

table.insert(toolTable, tool) -- change tool to whatever the name of your thing is

table.sort(toolTable)

for I, v in pairs(toolTable) do
--do stuff here using v as a variable
end

Im using roblox builted in inventory, I am trying to arrange the inventory items, like when you press 1 u get your gun from the Player.Backpack but i want it to be sword instead

local toolTable = {}



table.insert(toolTable, tool) -- change tool to whatever the name of your thing is

table.sort(toolTable)

for I, v in pairs(toolTable) do
     if v then
v:Clone().Parent = player.Backpack -- assuming you have a variable for the player
end
end

Do you even know what I’m saying

Sorry, I’m assuming your talking about the player’s Backpack?

He is trying to arrange the items’ order in the hotbar, for example sword as 1 and gun as 2.

Yes, the backpack hotbar. I know that, just trying to confirm it.

yea thats what I am trying to do