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

Is the ID Asset ID (aka Image ID) or Decal ID? Decals won’t work.
Also, you must define the icon befower setting image:

local Icon = require(game:GetService("ReplicatedStorage").Icon) -- in hope the module is located in ReplicatedStorage

local test = Icon.new() -- you don't need to define variable, you can use the code in example instead

test:setImage(6326373239)
-- or you can use
test:setLabel("Test")
:setImage(6326373239)

Hope it helped! Otherwise I don’t know where the issue can be.

2 Likes

How to do the icon action inside the bindEvent?

Icon.new()
:bindEvent("selected", function()
	Icon:lock() -- this line doesn't work

The Image ID works the best. That’s what I did. You can also post images/decals/assets for free by the way.

End of function is missing
after you define the event

:bindEvent("selected", function()

you also need to close the function:

end)

Your code then will looks like:

Icon.new()
:bindEvent("selected", function()
	Icon:lock() -- this line should work
end)

I was writing this code from head - there is possibility I made a mistake. If I will find a mistake, I will edit this message asap.

I don’t understand your reply man …

First, the reply is dedicated for someone else.
Secondly, that one was saying his function is not working, so I tried to help him in the way I can (in hope Ben won’t need to responde).

I also know I can upload my own decals / images or even assets (like Models, etc.); only Audio and some clothing are limited by Bobuxs.

I don’t you to feel bad for your response, absolutely not, just don’t understand what you wanted to say with it, sorry.

I understand that you were asking someone else.

I was just offering extra information that I thought would be help. You can take it or leave it. Its your choice. :man_shrugging:

Also, what I mean when I said the image ID works best in Set Image for the Icon because its more generic.

1 Like

I’ve already tried several ways to enable/disable a ScreenGui called “shopFrame”. The “Test me” button is visible but when I click on the know nothing happens.

I hope below script and image helps me solve the problem.

-- Within a LocalScript in StarterPlayerScripts and assuming TopbarPlus is placed in ReplicatedStorage

local Icon = require(game:GetService("ReplicatedStorage").Icon)

local icon = Icon.new()

icon:setImage(6399193086)

icon:setLabel("Test me")

:bindEvent("deselected", function()

game.StarterGui.shopFrame.Enabled = false

end)

:bindEvent("selected", function()

game.StarterGui.shopFrame.Enabled = true

end)

image

You can’t change UI under StarterGui inside of a live game.
You’d need to do this:

player.PlayerGui.shopFrame.Enabled = boolean

When I do Module.new() it errors! And It says require(assetId) cannot be called from client.

Show code…? You’re probably doing something wrong.

I’m wondering…

Screenshot (17)

if something like this possible…

local icons = require(game:GetService("ReplicatedStorage"):WaitForChild("TopbarPlus"))

local icon = icons.new()

icon:SetLabel("Create lobby")

icon:SetImage(8114476113)

Not with the current module no, I don’t think it’s possible. However you could create your own GUI under the top bar showing how many people are left.

It could be possible in a really hacky way with havina dropdown menu and having the dropdown open at all times, but I wouldn’t do this.

So how can I make it open all time without select any button

Just make sure the icon with the dropdown menu is selected at all times.

Call :select when the initial script is ran, then lock the button from being toggled.

I did BUT the dropdown icon still not open and I need to select the button first then it will work

Show the error putting out in the console.

Should be…

icon:setLabel("Create lobby")

icon:setImage(8114476113)

Remember, typos can interfere with your scripts!

I’m currently using topbar+ in many of my projects but there’s one thing;

I can’t link a GUI with a dropdown… it frustrates me a lot, I’m not good with scripting so I’m not sure if I’m doing this right… please help?

I’m having a problem where toggle items remain hidden after a character dies and respawns. I have Icon installed in ReplicatedStorage and a TopbarManager in StarterPlayerScripts. I created a minimal script that you can use to recreate the problem:

local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Icon = require(ReplicatedStorage.Icon)

local player = Players.LocalPlayer
local screenGui = player:WaitForChild("PlayerGui"):WaitForChild("ScreenGui")

local textLabel = Instance.new("TextLabel")
textLabel.Position = UDim2.new(0.5, 0, 0.5, 0)
textLabel.Text = "Welcome to this game..."
textLabel.TextSize = 30
textLabel.Visible = false
textLabel.Parent = screenGui

local helpIcon = Icon.new()
:setLabel("Help")
:setMid()
:bindToggleItem(textLabel)

Any suggestions?