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

Can’t see much problem. Again, I don’t see anything like the icon being created again and again. Would you try to remove and insert the icon module again?

1 Like

Weird. I can’t reproduce this at all. Can you try debugging where you fire the remote event and see if it’s just printing and printing or stops to a specific amount?

1 Like

Hi,

I am just testing and when the button is clicked the icon changes from my imange to a black box and I cant figure out why?

image

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local PlayerGUI = player.PlayerGui
local Icon = require(game:GetService("ReplicatedStorage").Modules.Icon)
local IconController = require(game:GetService("ReplicatedStorage").Modules.Icon.IconController)
local ToggleUI = PlayerGUI:WaitForChild("ToggleUI")
local Bindable = Instance.new("BindableEvent")


local icon = Icon.new()
	:setLabel("Settings")
	--:setLabel("Hovering", "hovering")
	:bindEvent("selected", function() print("Selected") end)
	:bindEvent("deselected", function() print("Deselected") end)	
	:notify(Bindable.Event)
	:setImage("rbxassetid://11387494898")
	:bindToggleKey(Enum.KeyCode.M)
	:bindToggleItem(ToggleUI)
1 Like

How would one should go about connecting a top bar button with a screen gui?

I want to add a function so when the player clicks a topbar icon, it opens a menu to customize a character, with a different camera angle and everything.

Without too many details, i dont know how to connect the screen gui to topbar buttons :confused:

local StarterGui = game:GetService("StarterGui")
local ScreenGui = StarterGui.***

Icon.new()
	:bindEvent("selected", function(icon)
		ScreenGui.Enabled = true
		print("selected!")
	end)
	:bindEvent("deselected", function(icon)
		ScreenGui.Enabled = false
		print("deselected!")
	end)

Replace *** with the path to your ScreenGui.

3 Likes

I have some questions:

  1. How do I require the IconController?
  2. Can I toggle a Topbar Button by pressing a gui button? And how?

You should at least know the basics of scripting and require(...)

A sample code:

local IconController = require(path.to.icon.IconController)
-- Do stuff with IconController

-- ...
-- ...

TextButton.MouseButton1Click:Connect(function()
    icon:select()
end)

I already figured out how do require the IconController, thanks though.

But your examples are very vague for my second question.

Edit: Just figured it out myself again, thanks for the help though. P.S. Just didn’t know the path to the IconController.

Found 2 bugs related to the voice chat adjustments:

  1. If you disable the chat, one of your icons will be covered by the Beta icon


    I disable the chat to make the UI stand out more on mobile.

  2. If the experience does not have voice chat enabled, but the player has their voice chat enabled in their Settings, there will just be a large gap.
    image

3 Likes

how would i integrate this with cindering’s background music toolkit?

You’ll need to give more of an explanation. How do you want the Topbar button to trigger when pressed?

i want a button on the topbar to mute the music playing from the toolkit
i have the button i just don’t know how to link it into the music toolkit

local mute = Icon.new()
mute:setCaption("Mute")
mute:setImage(166377448, "deselected")
mute:setImage(6413981913, "selected")
mute:setLeft()

mute.deselected:Connect(function()
	-- unmute music
end)
mute.selected:Connect(function()
	-- mute music
end)

Is there a way to make a certain Icon only enabled for a certain group rank?

Yep.

Create a RemoteEvent in ReplicatedStorage. Name it “GroupRankIconEvent”

-- Server Script
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage.GroupRankIconEvent

Players.PlayerAdded:Connect(function(player)
   if player:GetRankInGroup(GROUPID) == GROUP_RANK then
      RemoteEvent:FireClient()
   end
end)
-- Local Script
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Icon = require(ReplicatedStorage.Icon)

ReplicatedStorage.GroupRankIconEvent.OnClientEvent:Connect(function()

local icon = Icon.new()
-- other icon code here

end)
2 Likes

You can just check the rank on the client, no need for the unnecessary remote event.

Then exploiters would be able to easily modify the Group Rank Requirement to see the module.

But since exploiters can see the PlayerGui anyway, perhaps it doesn’t matter.

Even still - exploiters can see the code that runs when the GroupRankIconEvent is fired, so it doesn’t really matter anyway.

is there a way to tie pressing a topbar button to opening a menu? like once a button is clicked it activates a customization menu with custom camera and all… i want to use the buttons i can get from this instead of regular buttons since they look cleaner.

1 Like

nah checking in the serverside for group ranks will do no protection, if the gui has some dangerous functions or buttons you dont want normal players to access, make sure you check who clicked the button in the server side when the dangerous remote is fired.

1 Like

Yes, that’s possible.

You use :bindToggleItem

icon:bindToggleItem(path.to.Gui)
1 Like