**This is an excerpt from the script of one of my toolbar slots
t = script.Parent --Toolbar GUI, first slot
tool = script.Parent.ToolFolder.Tool --The assigned tool
player = game.Players.LocalPlayer --The player equipping and unequipping
equipped = false --Becomes true when the tool is equipped to signify that it is equipped
function EquipTool() --For equipping the tool
player.Humanoid:EquipTool(tool) --Code to equip the assigned tool
end
function UnequipTool() --For unequipping the tool
???
end
t.MouseButton1Up:connect(function() --Click the GUI to equip or unequip
if equipped == false then
EquipTool() --Equip tool
equipped = true
elseif equipped == true then
UnequipTool() --Unequip tool
equipped = false
end
end)
The problem is that I do not know what code to put for the UnequipTool function; there is a built-in function for equipping a tool, which is EquipTool(), but there isn't one for unequipping a tool. How would I make this happen?

1 comment
Thank you very much! It worked! ^.^