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)