Assuming you reference the modules correctly, this is fine to do too!
I’m going to be using the script for a new frame which I want only staff to see. How would I make it so the Icon is only accessible by a certain group rank?
game.Players.PlayerAdded:Connect(function(Player)
if Player:GetRankInGroup(2) == 255 then
-- Here you copy the local script in the player scripts or you call a RemoteEvent then client will by detect for show the TopBar
else
-- this is sad, the player is not Admin
end
end)
@Med367367 I’m assuming the source code is within the module, so the module
@index_l You can achieve this by checking for the local players rank, using GetRankInGroup, then either:
-
Hiding the icon if the local player is not of the desired role by doing
icon:setEnabled(false)
-
Only creating the icon if the player is your desired role
Amazing work with this! This will really help change the Topbar easily!
@ForeverHD, can you set the display order higher?
Like to 5?
As I have a scirpt that has to do it as it’s currently at 0.
Sure can, use iconController:setDisplayOrder for this! You can also modify the ZIndex of individual icons by doing icon:setBaseZIndex.
Feature request: To help make Topbar+ look even more like Roblox’s topbar API; can you make it so the icons disappear when MenuOpened
(see GuiService)
You can now align icons left or right using icon:setLeft() and icon:setRight(). Big thanks to @JohnnyMorganz for this feature!
@ElliottLMz Icons now automatically disappear when the Roblox menu is toggled. Thanks for the suggestion!
Hey I have a question to ask say for instance that i create a settings button and can i notify()
from another script because I’m not sure how to do that.
Sure can! Simply retrieve the icon object you wish to notify, then call the notify method:
local IconController = require(your.reference.to.the.IconController)
local icon = IconController:getIcon("yourIconName")
icon:notify()
We’ve been having reports from players that Topbar+’s icons are being behind the chat icon, rather than next to it.
We change the Chat visibility somewhat regularly so this is very problematic for our game.
Do you have any images of this, and any definitive ways to reproduce?
Also…
- How are you changing the chat visibility? (e.g.
game:GetService("StarterGui"):SetCoreGuiEnabled("Chat", false)
- Are you creating a fake chat icon with
IconController:createFakeChat()
- When did you start receiving these reports?
Alright thanks! Very useful instead of making lots of side guis.
Whenever you go to freecam mode (Shift + P) then go back to non-freecam, it disables the chat icon, and only the chat icon.
Good spot, I’ll open up an issue for this
Introducing…
Tips
Dropdowns
Console Support
(plug-in a controller to test)
Gradients
Cell Sizes & New Alignments
Behavioural Improvements & Bug Fixes
Including a state overlay @ElliottLMz (the color and transparency changes when an icon is hovered over and pressed) and a fix for the chat when the free cam is toggled @6cv3.
Huge thanks to @Lucke0051 for many of these features!
Get Started
You can learn about implementing and using these new features at the docs.
How do I add the dropdowns to HD Admin?
You can apply a dropdown to an icon by doing something like the following:
icon:createDropdown({
{
name = "About",
icon = "rbxassetid://2746077483",
clicked = function()
print("Navigate to About")
end,
events = {}
},
{
name = "Commands",
icon = "rbxassetid://2746074974",
clicked = function()
icon:select()
end,
events = {icon.selected}
},
{
name = "Roles",
icon = "rbxassetid://2746105644",
clicked = function()
print("Navigate to Roles")
end,
events = {}
},
{
name = "Settings",
icon = "rbxassetid://2746112353",
clicked = function()
print("Navigate to Settings")
end,
events = {}
},
})
For HD Admin itself, we don’t intend to add a dropdown until V3. You can retrieve the V2 icon by doing:
local hdMain = require(game:GetService("ReplicatedStorage"):WaitForChild("HDAdminSetup")):GetMain()
local TopbarController = hdMain:GetModule("TopbarClient")
local hdIcon = TopbarController:getIcon("HDAdmin")