Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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!

0
dISaBle The NUmbeR buTtONS! sonysunny 36 — 5y
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. SerpentineKing 3885 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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.

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. User#26817 0 — 5y
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. Babyseal1015 56 — 5y
0
I'll try that. User#26817 0 — 5y
0
It worked! Thanks! User#26817 0 — 5y
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 crabbyninja 58 — 5y
Ad

Answer this question