[v3!] TopbarPlus v3.0.0 | Construct intuitive topbar icons; customise them with themes, dropdowns, captions, labels and much more

image
Hi how can I do this ?? to the admin

The reason this is happening is because your ‘resizeInfo’ is out of sync with your ‘repositionInfo’. You have to ensure those tween time values are the same if you want the icon to remain in its relative space, especially if using a hovering effect.

0.2 (repositionInfo) vs 0.15 (resizeInfo) for your case.

Also as a tip, you don’t have to call :set("resizeInfo", openTween) for every single icon, you can modify it within the BlueGradient themes module (or whatever theme you require) instead.

1 Like

You can customise that here:

Please note this isn’t the official help thread for that, we’ll have one setup once Nanoblox is released (feel free to DM or https://twitter.com/hdteamroblox for the time being)

1 Like

Some things for example if I can’t get out, can I ask you again?

image
Did I do something?

1 Like

Hi again!

When using a Dropdown menu, the icon within the menu doesn’t seem to adjust it’s size:
image
This is calling :setLabel() after the icon has been setup in the dropdown. My expected behavior would be that the width of the icon should update like with the uppermost icons when updating their label.

Another small thing I noticed is that the healthbar displays over the icons on the right-hand side:
image
I think hiding the healthbar would be the best option, just like the Leaderstats. (if that is possible)

Cheers for the report, I’ll aim to have these fixed for the next update:

2 Likes

Currently I’m making an admin panel and I was wondering if there was a way to make it so only a certain rank and above will be able to see the icon or menu.

local player = game:GetService("Players").LocalPlayer
local playerGui = player.PlayerGui
local replicatedStorage = game:GetService("ReplicatedStorage")
local iconModule = replicatedStorage.Icon
local Icon = require(iconModule)
local IconController = require(iconModule.IconController)
local Themes = require(iconModule.Themes)
local adminMenu = game.StarterGui["Admin Gui"]

Icon.new()
:setName("AdminPanel")
:setImage(7072721855)
:setLabel("Admin Panel")
:bindEvent("selected", function()
	adminMenu.Visible = true
end)
:bindEvent("deselected", function()
	adminMenu.Visible = false
end)
:setName("AdminIcon")
:give(function(icon)
	return adminMenu.CloseButton.MouseButton1Click:Connect(function()
		icon:deselect()
	end)
end)

icon:setEnabled(bool) will help achieve this:

local canViewIcon = false
if isAnAdmin then
    canViewIcon = true
end

Icon.new()
    :setEnabled(canViewIcon)
2 Likes

I’ve tried this but it still doesn’t seem to work in game, have I done something wrong. No error shows up in the output?

game.Players.PlayerAdded:Connect(function(Player)

local player = game:GetService("Players").LocalPlayer
local playerGui = player.PlayerGui
local replicatedStorage = game:GetService("ReplicatedStorage")
local iconModule = replicatedStorage.Icon
local Icon = require(iconModule)
local IconController = require(iconModule.IconController)
local Themes = require(iconModule.Themes)
local adminMenu = game.StarterGui["Admin Gui"]
local canViewIcon = false
if Player:GetRankInGroup(10565031) >= 1  then
	canViewIcon = true
end


Icon.new()
:setEnabled(false)
:setName("AdminPanel")
:setImage(7072721855)
:setLabel("Admin Panel")
:bindEvent("selected", function()
	adminMenu.Visible = true
end)
:bindEvent("deselected", function()
	adminMenu.Visible = false
end)
:setName("AdminIcon")
:give(function(icon)
	return adminMenu.CloseButton.MouseButton1Click:Connect(function()
		icon:deselect()	
		end)
	end)
end)

That should be canViewIcon not false.

2 Likes

This still didn’t seem to change anything, and nothing is showing in the output either…?

game.Players.PlayerAdded:Connect(function(player)

local player = game:GetService("Players").LocalPlayer
local playerGui = player.PlayerGui
local replicatedStorage = game:GetService("ReplicatedStorage")
local iconModule = replicatedStorage.Icon
local Icon = require(iconModule)
local IconController = require(iconModule.IconController)
local Themes = require(iconModule.Themes)
local adminMenu = game.StarterGui["Admin Gui"]
local canViewIcon = false
if player:GetRankInGroup(10565031) > 6 then
	canViewIcon = true
end


Icon.new()
:setEnabled(canViewIcon)
:setName("AdminPanel")
:setImage(7072721855)
:setLabel("Admin Panel")
:bindEvent("selected", function()
	adminMenu.Visible = true
end)
:bindEvent("deselected", function()
	adminMenu.Visible = false
end)
:setName("AdminIcon")
:give(function(icon)
	return adminMenu.CloseButton.MouseButton1Click:Connect(function()
		icon:deselect()	
		end)
	end)
end)

This is because you have put your code in a PlayerAdded function but since this is a localscript, the player has already joined the game. Removing game.Players.PlayerAdded:Connect(function(player) and the accompanying end) will fix it.

1 Like

Now it works, thanks for the help. Didn’t realize that could happen so thank you.

I’m currently having a tiny issue where the frame won’t appear even though its visible?

local player = game:GetService("Players").LocalPlayer
local playerGui = player.PlayerGui
local replicatedStorage = game:GetService("ReplicatedStorage")
local iconModule = replicatedStorage.Icon
local Icon = require(iconModule)
local IconController = require(iconModule.IconController)
local Themes = require(iconModule.Themes)
local adminMenu = game.StarterGui.AdminGui
local adminFrame = game.StarterGui.AdminGui.Frame
local playerUI = player:FindFirstChild("PlayerGui")
local canViewIcon = false
if player:GetRankInGroup(10565031) > 6 then
	canViewIcon = true
end


Icon.new()
:setEnabled(canViewIcon)
:setName("AdminPanel")
:setImage(7072721855)
:setLabel("Admin Panel")
:bindEvent("selected", function()
	playerUI.AdminGui.Frame.Visible = true
	adminFrame.AnchorPoint = Vector2.new(0, 0)
	adminFrame.Position = UDim2.new(1.1, 0, 0.178, 0)
	wait(0.5)
	adminFrame:TweenPosition(UDim2.new(0.83, 0, 0.178, 0))
end)
:bindEvent("deselected", function()
	adminFrame.AnchorPoint = Vector2.new(0, 0)
	adminFrame.Position = UDim2.new(0.83, 0, 0.178, 0)
	wait(0.5)
	adminFrame:TweenPosition(UDim2.new(1.1, 0, 0.178, 0))
end)

Are you sure the ScreenGUI is enabled?

Is there a option to change the font of a label?

You can achieve this by customising iconFont within your theme (learn more about themes here):

Or alternatively by modifying the setting of an individual icon:

icon:set("iconFont", Enum.Font.GothamSemibold)

Could exploiters potentially use :BindEvent as a backdoor to the serverside? Can exploiters use the module themselves? Is there any protection from them?

icon:bindEvent simply connects a function to a given signal. Everything is client-sided so there’s nothing (such as remotes) to be exploited.

1 Like