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

How to prevent this HopperBin glitch?

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

0

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.

2 answers

alright.

--messy code, but I like to write it in messy. sorry.
for i,v in pairs(game.Players:getChildren()) do
if v.Backpack.Move then
v.Backpack.Move:Destroy();
end;
if v.Backpack.Copy then
v.Backpack.Copy:Destroy();
end;
end;
--Localscript is required. might not work, but just try.

3 comments

0

I don't see why it matters but there you go

0

It doesn't work. This is more or less the first thing I tried. There's some strange glitch where the tool is no longer in your inventory and the tool is permanently selected.

0

This is actually a glitch on roblox for some reason-

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