Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I force a player to keep holding a tool?

When the player clicks on a block, they receive a tool from the ServerStorage. How can I make sure that the tool is always equipped when the player has it? Thanks in advance!

2 comments

0

dISaBle The NUmbeR buTtONS!

0

Well you can't directly force the player to never remove the tools without disabling keys and/or the backpack. However, you can requip the tool everytime it is unequipped.

1 answer

✓ Accepted answer

You can disabled the backpack. When you disable the backpack and a player picks up/holds a tool they cannot unequip the tool.

To disable the backpack you need a Local Script in StarterGui and put this:

game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)

This will disable the back pack thus allowing you to stop a player from unequipping an item.

5 comments

0

That didn't work, the tool is coming from ServerStorage, so when is copied to the player's backpack, it is not equipped automatically.

1

Hmm. What you could do is try teleport the tool right above the player and when the player touches the tool it will auto equip.

0

I'll try that.

0

It worked! Thanks!

0

You can Humanoid:EquipTool to force a player to equip a tool, you can also use Humanoid:UnequipTools if you want to force the player to unequip their tool

This discussion is preserved as it was. New answers, comments, and votes are closed.