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

How to prevent this HopperBin glitch?

Asked by 10 years ago

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"
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. M39a9am3R 3210 — 10y

2 answers

Log in to vote
1
Answered by 10 years ago

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.
0
I don't see why it matters but there you go Prohibetur 70 — 10y
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. Prohibetur 70 — 10y
0
This is actually a glitch on roblox for some reason- Adryin 120 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

Found the answer here http://www.roblox.com/Forum/ShowPost.aspx?PostID=81967349

I have to parent it to something other then the backpack. Set the active property to false. Set the backpack back to the parent and then finally delete it.

Answer this question