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

Activate Hopperbin through GUI?

Asked by
Cuvette 246 Moderation Voter
8 years ago

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
I would not use HopperBins as they are deprecated http://wiki.roblox.com/index.php?title=API:Class/HopperBin User#5423 17 — 8y
0
Yeah that's a good point, I converted it to a tool then used the EquipTool function to force it. Thanks (: Cuvette 246 — 8y

Answer this question