NeoHotbar | A modern, customizable hotbar

Good work @ImAvafe, I made this simple fix to unlock the cursor whenever the player is in first person camera

local CollectionService = game:GetService("CollectionService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Packages = ReplicatedStorage:WaitForChild("Packages")
local NeoHotbar = require(Packages.NeoHotbar)

local TOOL_BUTTON_TAG = "NeoHotbarToolButton"

if not NeoHotbar.Started then
	NeoHotbar:Start()
end

local managementModeActive = NeoHotbar.States.ManagementMode.Active
local setMangementModeActive = managementModeActive.set
local toolButtons: { GuiButton } = {}

local function onToolButtonAdded(toolButton: Instance)
	if not toolButton:IsA("GuiButton") or table.find(toolButtons, toolButton) then
		return
	end

	toolButton.Modal = managementModeActive:get()
	table.insert(toolButtons, toolButton)
end

local function onToolButtonRemoved(toolButton: Instance)
	if not toolButton:IsA("GuiButton") then
		return
	end

	local index = table.find(toolButtons, toolButton)
	if not index then
		return
	end

	toolButton.Modal = false
	table.remove(toolButtons, index)
end

managementModeActive.set = function(self, newValue, force)
	for _, toolButton in toolButtons do
		toolButton.Modal = newValue
	end

	setMangementModeActive(self, newValue, force)
end

for _, toolButton in CollectionService:GetTagged(TOOL_BUTTON_TAG) do
	onToolButtonAdded(toolButton)
end

CollectionService:GetInstanceAddedSignal(TOOL_BUTTON_TAG):Connect(onToolButtonAdded)
CollectionService:GetInstanceRemovedSignal(TOOL_BUTTON_TAG):Connect(onToolButtonRemoved)

2 Likes

Hi,
On the demo game, why when I have the Toggle Custom Button on, and then hit the

`
key (was going to see if it opens the backpack ) … it then toggles
t Custom Button… like off and on?

hit
`

  1. What devices does this support, and are you still updating it? (Console, Phone , PC, etc…)…

  2. Why doesn’t the gun show the new option with the bullets left?

  3. if the backpack ( ` ) is turned off, does that then allow unlimited tools?

Thanks

The sample custom theme doesn’t support a few features.

Tysm dude
This was useful
Like it super insane

1 Like

Super cool, but how would I add a drag-and-drop system, if that makes sense? And, are credits required to give, I don’t mind giving them.