Last active
November 30, 2025 09:48
-
-
Save ryanlua/42274f0d1347ce5d2c68a570200c1dcb to your computer and use it in GitHub Desktop.
Creates a TopbarPlus dropdown that allows you to add Tools and HopperBins to the backpack along with clearing it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --!strict | |
| local Players = game:GetService("Players") | |
| local ReplicatedStorage = game:GetService("ReplicatedStorage") | |
| local Icon = require(ReplicatedStorage.Packages.topbarplus) | |
| local player = Players.LocalPlayer :: Player | |
| local toolIcon = Icon.new() | |
| toolIcon:setLabel("Backpack Options") | |
| toolIcon:align("Right") | |
| toolIcon:setDropdown({ | |
| Icon.new() | |
| :setLabel("Add Tool") | |
| :bindEvent("deselected", function() | |
| local backpack = player:FindFirstChildOfClass("Backpack") :: Backpack | |
| local tool = Instance.new("Tool") | |
| tool.Parent = backpack | |
| end) | |
| :oneClick(), | |
| Icon.new() | |
| :setLabel("Add HopperBin") | |
| :bindEvent("deselected", function() | |
| local backpack = player:FindFirstChildOfClass("Backpack") :: Backpack | |
| local hopperBin = Instance.new("HopperBin") | |
| hopperBin.Parent = backpack | |
| end) | |
| :oneClick(), | |
| Icon.new() | |
| :setLabel("Clear Backpack") | |
| :bindEvent("deselected", function() | |
| local backpack = player:FindFirstChildOfClass("Backpack") :: Backpack | |
| backpack:ClearAllChildren() | |
| end) | |
| :oneClick() | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment