Custom topbar buttons module Made by Stonetr03
My Topbar buttons module just adds more buttons to the top bar and you can configure the buttons and sizes. I also made this because I found Topbar+ a big hard to learn / Use
In 4.0.0 Update you can Configure Buttons, Example :
If you would like to see more Customization features please reply to the forum post.
Module :
https://www.roblox.com/library/5969925996/Custom-Topbar-Buttons-Module
Version 2.0.0 Change Log
- Added Dropdown Buttons
Version 3.0.0 Change Log
-
Removed ability to add/edit/remove buttons From the Server, If you want to still be able to do this download the v2.0 code from Github
-
Rewrote code for creating the GUIs.
Version 4.0.0 Change Log
-
Added Customization to Buttons
-
Minor Improvements / Bug Fixes
Version 4.0.1 Change Log
- Fixed Dropdown Buttons
Topbar Buttons Module v4.0.0 API :
Adding a button
Adding a button
Module:Add("Button Name",ImageId, Left Side of Topbar true/false, Configurization Table See Configuring a Buttons appearance for more info)
This will return the button property, that can now allow you to call Button.MouseButton1Clicked or something like that
If there was an error or one of the required properties isn’t filled out properly, the function will return false
The first property is the button name
The second property is the ImageId which will show up on the topbar
The third property is if you want it on the left side or the right side of the topbar, setting this value to true will make it on the left side, setting this value to false will make the button be on the right side of the topbar
The fourth property is an optional configuration table that calls Module:ConfigButton() for you so your code is cleaner.
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
local Button = TopbarModule:Add("Client Example Button","rbxassetid://5898088380",true,{
Width = UDim.new(0.1,30),
ScaleType = Enum.ScaleType.Stretch,
SliceCenter = Rect.new(Vector2.new(10,10),Vector2.new(10,10)),
BaseColor = Color3.fromRGB(0,255,0),
IconColor = Color3.fromRGB(0,0,255)
})
Button.MouseButton1Click:Connect(function()
print("Clicked!")
end)
*Gear icon was from the toolbox on search of “Settings”
Removing a button
Removing a button
Module:Remove("Button Name")
This will return true if successfully removed, or the function will return false if there was an error while removing it
The first property is the Button Name
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:Remove("Example Button")
Hiding a button
Hiding a button
Module:Hide("Button Name")
This will return true if successfully hid, or the function will return false if there was an error while hiding it
The first property is the Button Name
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:Hide("Example Button")
Showing a button
Showing button
Module:Show("Button Name")
This will return true if successfully shown, or the function will return false if there was an error while showing it
The first property is the Button Name
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:Show("Example Button")
Changing a buttons image
Changing a button’s image
Module:ChangeImage("Button Name", ImageId)
This will return true if successfully changed, or the function will return false if there was an error while changing it
The first property is the Button Name
The second property is the ImageId also include the “rbxassetid://”
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:ChangeImage("Example Button","http://www.roblox.com/asset/?id=5010019455")
Get notification value
Get Notification Value
Module:GetAmount("Button Name")
This will return the amount in the notification icon, or the function will return false if there was an error while getting the value
The first property is the Button Name
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
print(TopbarModule:GetAmount("Example Button"))
Set Notification Value
Set Notification Value
Module:SetAmount("Button Name",Amount)
This will return true if successfully set the amount, or the function will return false if there was an error while setting the value
The first property is the Button Name
The second property is the amount
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:SetAmount("Example Button",10)
Add notification value
Add Notification Value
Module:AddAmount("Button Name",Amount)
This will return true if successfully set the amount, or the function will return false if there was an error while setting the value
The first property is the Button Name
The second property is the amount
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:AddAmount("Example Button",1)
Remove Notification Value
Remove Notification Value
Module:RemoveAmount("Button Name",Amount)
This will return true if successfully set the amount, or the function will return false if there was an error while setting the value
The first property is the Button Name
The second property is the amount
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:RemoveAmount("Example Button",1)
Add Dropdown Button
Add Dropdown button
Module:CreateDropdownButton("Dropdown Button name","Topbar button name","Text")
This will return the button instance if successfully added the button, or the function will return false if there was an error while adding the button
The first property is the Dropdown Button Name
The second property is the Name of the button that will be added too
The third property is the Text that will be added to the dropdown button
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:CreateDropdownButton("ExampleDropdown","TopbarButtonName","Dropdown Button!")
Remove Dropdown Button
Removing Dropdown button
Module:RemoveDropdownButton("Dropdown Button name","Topbar button name")
This will return true if successfully removed the button, or the function will return false if there was an error while removing the button
The first property is the Dropdown Button Name
The second property is the Name of the top bar button that the Dropdown Button is in
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:RemoveDropdownButton("ExampleDropdown","TopbarButtonName")
Hide Dropdown Button
Hideing Dropdown button
Module:HideDropdownButton("Dropdown Button name","Topbar button name")
This will return true if successfully hid the button, or the function will return false if there was an error while hiding the button
The first property is the Dropdown Button Name
The second property is the Name of the top bar button that the button is in
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:HideDropdownButton("ExampleDropdown","TopbarButtonName")
Show Dropdown Button
Showing Dropdown button
Module:ShowDropdownButton("Dropdown Button name","Topbar button name")
This will return true if successfully shown the button, or the function will return false if there was an error while hiding the button
The first property is the Dropdown Button Name
The second property is the Name of the top bar button that the button is in
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:ShowDropdownButton("ExampleDropdown","TopbarButtonName")
Edit Dropdown Button Text
Edit Dropdown button Text
Module:EditDropdownButton("Dropdown Button name","Topbar button name","New Text")
This will return true if edited the button, or the function will return false if there was an error while hiding the button
The first property is the Dropdown Button Name
The second property is the Name of the top bar button that the button is in
The third property is the New Text
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:EditDropdownButton("ExampleDropdown","TopbarButtonName","New Text!")
Reset Dropdown Button Size
Reset Dropdown button Size
Module:ResetDropdownSize("Topbar button name")
This will return true if reset the button size, or the function will return false if there was an error while hiding the button
The first property is the Top bar Button Name
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:EditDropdownButton("TopbarButtonName")
Configure a button's appearance
Configure a button’s appearance
Module:ConfigButton("Topbar button name",Configure Table)
This will return nothing if the button was successfully configured, or the function will return false if there was an error while configuring the button
The first property is the Topbar Button Name
The second property is a table that looks like this :
{
Width = UDim.new(0.1,30),
ScaleType = Enum.ScaleType.Stretch,
SliceCenter = Rect.new(Vector2.new(10,10),Vector2.new(10,10)),
BaseColor = Color3.fromRGB(0,255,0),
IconColor = Color3.fromRGB(0,0,255)
}
Example
local TopbarModule = require(game.ReplicatedStorage.TopbarModule)
TopbarModule:ConfigButton("TopbarButtonName",{
Width = UDim.new(0.1,30),
ScaleType = Enum.ScaleType.Stretch,
SliceCenter = Rect.new(Vector2.new(10,10),Vector2.new(10,10)),
BaseColor = Color3.fromRGB(0,255,0),
IconColor = Color3.fromRGB(0,0,255)
})
If there are any bugs please reply to this forum post