It disables the usage of tools completely, which I do not want.
What solutions have you tried so far?
I’ve already tried recreating the equipping and unequipping (which I’ve done) but I was hoping if there is a way to ‘keep’ the tool usage mechanic while hiding the backpack / inventory / toolbar / hotbar as I feel my code to be otherwise clunky and highly unoptimised. I’ve also tried Shirooo’s solution but it also feels clunky to me.
Consider using Humanoid:EquipTool(toolName) and connecting it to a UserInputService keybind. Once the tool is equipped, it should be fully useable. I’ve done this myself in one of my games and it worked fine.
Eh kind of. That’s the code I already gave yet don’t want, as while the backpack IS usable, the equipping and unequipping (using 1 and 0) is disabled due to this and I STILL have to create new scripts for it, which I do not want to do.
Personally I don’t find it clunky. Here’s the code ripped straight from my game:
local keybinds = {"One","Two","Three","Four"}
if table.find(keybinds,input.KeyCode.Name) then
local toolName = _G.data.equippedWeapons[input.KeyCode.Name]
if toolName then
local tool = player.Backpack:FindFirstChild(toolName)
if tool then
char.Humanoid:EquipTool(tool)
--Unequipping is intentionally disabled for my game's purposes, but it's not that hard to do either
end
end
end
Pretty simple stuff honestly. Also easy to implement a custom GUI with.