How can I unequip a tool if a tool is already equipped?

I recently used this inventory module and it works amazing but I have no idea how to make it so you can not equip multiple tools at a time
InventorySystem_OpenSourced.rbxl (74.4 KB)

For some reason I can equip multiple tools.

I tried many solutions like deleting the object if there’s already a tool but those don’t work and just bug out the script.

Sorry for the bad formatting this is my first topic.

8 Likes

Maybe check if a tool is already equipped and if its already equipped don’t let you equip anymore?

Use Humanoid:UnequipTools() when pressing the “Equip” button.

7 Likes

Use what @DEVLocalPlayer said but another way (longer less efficient way) check if the tool is the char and then set the parent to player.Backpack

1 Like

There’s really no need to use that method when you can simply call Humanoid:UnequipTools() before equipping the new tool. With it you ensure the player doesn’t have any other tool equipped before equipping the new one.

23 Likes

Thanks alot! It’s always the simplest things I never think of XD

5 Likes

I just figured in my own game this our but if you want to unequip just one tool instead of everything just set the parent of the tool to the player’s backpack.

Tool.Parent = Player.Backpack