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

Hey there! I’m having a bit of an issue here with the module, the two icons interfere with eachother? I don’t quite know what I did wrong here but the code is here:

Script 1

local rs = game:GetService("ReplicatedStorage")
local icon = require(rs:WaitForChild("Icon"))

function createicon(id)

	local newicon2 = icon.new()

	newicon2:setImage("rbxassetid://" .. id)

	newicon2:bindEvent("selected", function()

		script.Parent.HelpMenu.Visible = true

	end)

	newicon2:bindEvent("deselected", function()
		
		script.Parent.HelpMenu.Visible = false

	end)

end

createicon(10951216726)

Script 2

function createicon(id)

	local newicon = icon.new()

	newicon:setImage("rbxassetid://" .. id)
	
	newicon:bindEvent("selected", function()
		
		workspace.BGM:Pause()
		
	end)
	
	newicon:bindEvent("deselected", function()
		
		workspace.BGM:Resume()

	end)
	
end

createicon(6824924955)

Everytime I click on the music pause button, it also interferes with the help button? No clue why.

You can just look at the document: Icon - TopbarPlus (1foreverhd.github.io)

2 Likes

I didn’t see that entry, thank you so much.

I don’t know how I can describe this issue, but when you move your mouse on the edge of the icon on the X axis in the center it kinda glitches. Here’s a video:

Could you add :WaitForChild() in Icon module?
I recently started to have errors when LocalScript running in ReplicatedFirst is waiting for Icon, but in the time of requiring other sub-modules aren’t present yet:

I already did fixed some of them and I forgot to take a proof of the error, but it seems I didn’t cover everything so here is the proof. (For example I edited iconModule.IconController to iconModule:WaitForChild("IconController").) I also think others could use this update, too, instead of just fixing it localy in my place.

Is there a way to dynamically add and remove items from an icon’s drop down? For example, I’m working on a button where a player can click it to show a list of all of the players in the game via a drop down. Is there a way to handle this logic without having to externally add in icons to the drop down frame?

1 Like

Hey all. I’m new to using TopbarPlus. I have to say, It’s a great tool! However, I’ve had some issues. Everything works besides the settings dropdown I’ve been trying to add. I’m simply trying to make it change it’s name when toggled as a test, but it’s just not working. It gives me an error saying "attempt to index nil with ‘setLabel’
Does anyone know how to fix this?

local setting = Icon.new()
	setting:set("iconFont", Enum.Font.GothamBold)
	setting:setImage("http://www.roblox.com/asset/?id=7059346373")
	setting:setTheme(BlueGradient)
	setting:setRight()
	
	setting:setDropdown({
		Icon.new()
		:setLabel("Server Chat Messages: On")
		
		:bindEvent("selected", function()
			ClickSound:Play()
			:setLabel("Server Chat Messages: Off")
		end)
		
		:bindEvent("deselected", function()
			ClickSound:Play()
			:setLabel("Server Chat Messages: On")
		end)
		,
		
	})

I’m pretty sure that doing :setLabel(...) inside the function is not possible. You have to define the main icon as the variable first, then specify the icon variable before the function.

Thanks for the quick reply. I found the solution after looking at the dropdown example in the TopbarPlus Playground. Now I just need to implement my existing working code into it. Thanks!

:bindEvent("selected", function(setting1)
			ClickSound:Play()
			setting1:setLabel("Server Chat Messages: Off")
		end)
		
		:bindEvent("deselected", function(setting1)
			ClickSound:Play()
			setting1:setLabel("Server Chat Messages: On")
		end)
		,
	})

Glad that you’ve the dropdown working now!

Thanks! It’s been a while since I added this settings dropdown, and I’ve added a lot of more things since then. I’ve wondered about this for a while, but is it possible to make my settings dropdown save for the player?

You would have to use DataStoreService for that, and just have the server send the data to the client on their settings.

I have the DataStoreService working, but I can’t add a “if, then” statement or else it breaks the script.

settingdrop:setDropdown({
		Icon.new()
		:set("iconFont", Enum.Font.GothamBold)
		:setLabel("AFK: Off")
		:setImage("http://www.roblox.com/asset/?id=11814551652")
		
		if player:FindFirstChild("AFKStatus").Value == 1 then
			:select()
		end

		:bindEvent("selected", function(afkbutton)
			afkbutton:setImage("http://www.roblox.com/asset/?id=5595886390")
			afkbutton:setLabel("AFK: On")
			ClickSound:Play()
			afkscript:FireServer()
			player.PlayerGui:FindFirstChild("AFKToggleGUI").unAFKPopup.Visible = true
			player:FindFirstChild("AFKStatus").Value = 1
			gui:SetCore("ResetButtonCallback",false)
			afkbutton:debounce(5)
		end)
1 Like

You need to have the data logic beforehand.

Could you go into a little more detail please? Do you mean I need to add a variable first?

Terrific! 10/10 Vouch

Only thing I would like is for the Topbar Icons to be a little more similar to the actual CoreGui buttons. Beside that, great!

They are. But if you want to customize them more to be the exact, you can customize the theme section in the module.

Alright, thanks for the insight.

This has to be one of the best things I have come across. Thank you for creating this!

Can you show the code where you type /board in the chat?

1 Like