Where to start with custom hotbar

basically i want a custom hotbar (already got some sort of custom inventory) that basically doesnt use the normal hotbar, but instead whenever the slot is click it adds the tool into the character to equip it

If that even made sense

You could disable the inventory CoreGui, then assign the tools that the player has in order, then from that you can use the Humanoid:EquipTool() function and select the tool from the backpack itself.

If you need some reference, here’s some code I made for a scrolling inventory system I made a while ago. Not the same thing that you’re asking, but should be helpful as a reference on how I got it to equip the tools.

local UIS = game:GetService("UserInputService")
local PS = game:GetService("Players")

local playerObject = PS.LocalPlayer
local character = playerObject.Character or playerObject.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
local currentOrder = 0

local debounce = false

local function SortTools(key, tools)
	local toolOrder = tools:FindFirstChild("ToolOrder")
	
	if key == "up" then
		if (currentOrder == 0 or currentOrder == 1) and toolOrder.Value == 3 then
			humanoid:EquipTool(tools)
			currentOrder = toolOrder.Value

		elseif toolOrder.Value < currentOrder and toolOrder.Value > currentOrder - 2 then
			humanoid:EquipTool(tools)
			currentOrder = toolOrder.Value
		end
	elseif key == "down" then
		if (currentOrder == 0 or currentOrder == 3) and toolOrder.Value == 1 then
			humanoid:EquipTool(tools)
			currentOrder = toolOrder.Value

		elseif toolOrder.Value > currentOrder and toolOrder.Value < currentOrder + 2 then
			humanoid:EquipTool(tools)
			currentOrder = toolOrder.Value
		end
	end
end

UIS.InputChanged:Connect(function(input, process)
	if process then
		return
	end
	
	if input.UserInputType == Enum.UserInputType.MouseWheel then
		if debounce == false then
			debounce = true
			
			local playerObject = PS.LocalPlayer
			local direction = input.Position.Z > 0 and "up" or "down"

			if direction == "up" then
				for _,tools in pairs(playerObject.Backpack:GetChildren()) do
					if tools:IsA("Tool") then
						SortTools("up", tools)
					end
				end
			elseif direction == "down" then
				for _,tools in pairs(playerObject.Backpack:GetChildren()) do
					if tools:IsA("Tool") then
						SortTools("down",tools)
					end
				end
			end	
			
			debounce = false
		end
	end
end)
1 Like

this could work, Although i was thinking something more of each player having their own “hotbar” and “inventory” folder, as thats already what i do for the inventory, also it would make it alot easier to save the items after death im pretty