Is there any way to Deactivate a tool?

Hello, I want to deactivate all the tools when a minigame in my game starts just so that no one can get any advantage. Is there any way to deactivate all the tools/gears in my backpack?

You can achieve this by removing all tools in the players backpack once they join a minigame.

Backpack:ClearAllChildren()

This will prevent them from equipping any tool.

1 Like

There’s a number of ways to achieve this.

  • You can try to move the tools to a temporary storage from all backpacks and their characters(if equipped).
    • If the tools are non-unique, you can just destroy them and save the references to their inventory in an array per player.
  • You can also try hindering tool activation by having two different values in boolean that prevents tool activation in client and server. Works like a debounce(looks like a guard statement).
1 Like

what about equipped ones? I tried just deleting the tools from the players character but it glitches the player out

By removing the tools from the players backpack should automatically unequip any currently equipped tools.

You could perhaps parent the character’s tools to player.Backpack once the game started. If they survive, parent it back to their character one the game finish

2 Likes

Parenting it to the backpack fixed it, thank you!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.