Hey, I'm trying to activate a hopperbin through a GUI button I've got. The localscript I've written below has no errors or anything but it doesn't quite activate the hopperbin.

Everything works fine when I click on the hopperbin on the toolbar but just not through the GUI

enabled = true;

script.Parent.MouseButton1Down:connect(function()
if enabled == false then
	game.Players.LocalPlayer.Backpack["Wood Wall"].Active = false
	wait(0.2)
	enabled = true;
	end
end)

script.Parent.MouseButton1Down:connect(function()
if enabled == true then
	game.Players.LocalPlayer.Backpack["Wood Wall"].Active = true
	
	wait(0.2)
	enabled = false;
	end
end)

2 comments

2

I would not use HopperBins as they are deprecated http://wiki.roblox.com/index.php?title=API:Class/HopperBin

0

Yeah that's a good point, I converted it to a tool then used the EquipTool function to force it. Thanks (: