How to swap tools hotbar slot

I just wanna swap a tool with another slot, like the image below. (With a script)
Screenshot 2025-01-26 052314
I couldn’t find any documentation on this, or even anything relating to it besides some dev forum posts on custom hot bars. So I’m questioning is it possible without unequipping tools similarly to how you can swap tools with your mouse.

  1. Get the flashlight from player’s inventory(which is called a backpack on Roblox Studio) via a script
  2. Take out the tool from player’s inventory and put it somewhere else
  3. Put the tool again into player’s inventory, now it will be in the first slot instead of the second

basically something like this:

local Plr:Player --Get the player here

for i,Tool in pairs(Plr.Backpack:GetChildren()) do
	if Tool:IsA("Tool") then
		Tool.Parent = script
		Tool.Parent = Plr.Backpack
	end
end

For multiple tools it requires the script to be more comprehensive

1 Like

You could script adding the tools into the Player’s inventory into the specific order you want.

If you want to shift a tool to a specific hotbar slot, you need to create your own Inventory system.

1 Like

Really was hoping that studio had a inbuilt system for this since it will trigger the ChildRemoved function.

Perhaps you can suggest this as a #feature-requests so Roblox can consider adding this as a supported inbuilt feature for the Inventory system.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.