I'm trying to make a custom backpack, but I can't find a function for equipping/unequipping a tool. Could someone help? If so, thanks! I think this might work:
toolInBackpack:Equip() --and for unequipping, toolInBackpack:Unequip()
I can't test this myself because ROBLOX Studio's Play Solo is broken.
A tool becomes equipped when it's parent is a character of a player.
With this being known, you can simply change the parent of the tool to the character when you want it to be equipped and to something else when you want it to be unequipped.
Example:
-- In this example I use the player's backpack as a place to store the tool, however the tool can be stored where ever you like. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false) -- This will disable all hotkeys for selecting tools along with removing the BackpackGui. local player = game.Players.Player local character = player.Character local tool = player.Backpack.Tool function equip(tool) tool.Parent = character end function unequip(tool) tool.Parent = player.Backpack end -- Simply call equip or unequip when you wish
Irrelevant question but does your solo crash too when you click stop and thats how its broken?
https://developer.roblox.com/api-reference/function/Humanoid/EquipTool and it's counter part https://developer.roblox.com/api-reference/function/Humanoid/UnequipTools