I have a script that inserts a move and clone tool into a players backpack. Later in the game I need it to be removed however. So I decided to simply try to :Destroy() it. This did work, however if the player had either tool selected while it was deleted the mouse would not change back to the default mouse and you could still use the tool. So I decided to try to deselect the tool before removing it but couldn't find a way of doing so. Any advice on how to remove the tool without this annoying bug?
Here's the code that adds the tools
--b is of course the Player
local c=Instance.new("HopperBin")
c.Parent=b.Backpack
c.TextureId="rbxasset://Textures/Clone.png"
c.BinType="Clone"
c.Name="Copy"
local m=Instance.new("HopperBin")
m.Parent=b.Backpack
m.TextureId="rbxasset://Textures/GameTool.png"
m.BinType="GameTool"
m.Name="Move"

1 comment
I would think changing the Active property of the Hopperbin to false would solve this problem, since it determines wether the Hopperbin is in use or not.