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

Hey! I was just wondering how could I make it so when a dropdown is selected all of its or one of its option gets deselected?

try using this

icon:setProperty("deselectWhenOtherIconSelected", false)
1 Like

sup, i need some help here

i’m trying to set the coregui enabled to false on click and to true when you deselect a button but i have multiple buttons so i have a small issue here, because when i switch from button to button it both enables and disables it because one’s being deselected and another is being selected which leads to the coregui being enabled unwantingly

example:


local PhoneIcon = Icon.new()
:setName("Phone")
:setLabel("Phone")
:bindEvent("selected", function(icon)
	CoreGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
end)
:bindEvent("deselected", function(icon)
	CoreGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
	CoreGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
end)
:setEnabled(true)

local ClanIcon = Icon.new()
:setName("Clans")
:setLabel("Clabs")
:bindEvent("selected", function(icon)
	CoreGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
end)
:bindEvent("deselected", function(icon)
	CoreGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, true)
	CoreGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
end)
:setEnabled(true)
2 Likes

is it the same problem that i have with my topbar?

you can see the video in the post.

he didnt respond to me yet. so we have to wait

1 Like

image
A little problem I found any fixes?

Im expericening a problem where they duplicate when you die how do i fix this?

Nevermid i shall not put localscripts in startergui

Is it possible using this to make a way to deselect a button from a different local script?

Why does this not toggle the gui when pressed

local Icon = require(game:GetService("ReplicatedStorage").Icon)
local icon = Icon.new()
	:setImage(9394951049)
	:setLabel("Proton Admin", "hovering")
	:bindToggleKey(Enum.KeyCode.V)
	:bindToggleItem(game.Players.LocalPlayer.PlayerGui.ProtonAdmin.AdminGUI)

Use :GetIcon(name) then icon:deselect()

Try this instead:

local Icon = require(game:GetService("ReplicatedStorage").Icon)
local Players = game:GetService("Players")
local icon = Icon.new()
	:setImage(9394951049)
	:setLabel("Proton Admin", "hovering")
	:bindToggleKey(Enum.KeyCode.V)
icon.deselected:Connect(function()
	Players.LocalPlayer.PlayerGui.ProtonAdmin.AdminGUI.Visible = false
end)
icon.selected:Connect(function()
	Players.LocalPlayer.PlayerGui.ProtonAdmin.AdminGUI.Visible = true
end)

This wouldn’t work - they asked how to deselect an icon from a different local script from the one the icon was originally created in.

Or did you mean to reply to @CanineData_Games1?

Yes I meant to reply to Canine. That was an accident lol. Sorry.

1 Like

Also how could I make the buttons only show up for certain players

Use an if statement around it and define what you would like to search for of that Player’s to see if they have the requirements, then you can put the code of making the icon inside of that if statement. (Basically, Make an if statement looking for a specific thing of the player, such as the UserID and if it is true then it runs the code inside the statement to make the icon)

I am experiencing constant issues with the scaling of tooltips on my icons. The text seems to out-wrap the white background. Do you know what could be causing this?
image

2 Likes

This doesn’t work or at least didn’t in my testing, No errors it just doesn’t make the button inside the if statement.

nvm fixed it

Good suggestion, you’d have to modify the internals to do this currently. I’ve opened a ticket for a feature to make that easy here:

I’ll have this fixed for the next version. Thanks for the report.

I can’t quite seem to reproduce this myself so I’ll DM you to explore it further. If anyone else experiences this issue feel free to DM me.

3 Likes

If you still need help we’ve created a video tutorial to now take you step by step through the setup, including where to create your local script, how to retrieve the ID of an image, and some of its basic features. Hope it helps! And big thanks to @Inctus for the tutorial:

3 Likes

How would I use debounce? When I select an Icon I want it to deselect itself after a few seconds.

1 Like