TopbarPlus Support // UI Error

Hey! So, im currently working with Topbarplus, and im trying to get it to when i click on the top bar UI, it opens a UI. But, it isn’t working. This is my current Code:

local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Icon =  require(ReplicatedStorage.Icon)
local StarterGui = game:GetService('StarterGui')
local GreetingsUI = require(StarterGui.MainUI.ContainerUI)

Icon.new()
	:setImage(17185842953)
	:bindEvent("deselected", function()
		GreetingsUI.Visible = not GreetingsUI.Visible
	end)
	print('Sucsess, carried out action.')
	:oneClick()

No matter how may different ways I try to reference it, it wont work. Initially, i did it like this:

local ReplicatedStorage = game:GetService('ReplicatedStorage')
local Icon =  require(ReplicatedStorage.Icon)
local GreetingsUI = game.StarterGui.MainUI.ContainerUI

Icon.new()
	:setImage(17185842953)
	:bindEvent("deselected", function()
		GreetingsUI.Visible = not GreetingsUI.Visible
	end)
	print('Sucsess, carried out action.')
	:oneClick()

Please help, thanks!

TopBarPlus or PromtPlus? The code looks like TopBarPlus.

oh, sorr, haha. wait there…

Just because I’ve been working with both, and yes it is Topbarplus. I am struggling with this still.

Alrighty, let’s try to troubleshoot this.

Here’s an example of what StarterGUI should look like:

local StarterGui = game.Players.LocalPlayer.PlayerGui

I haven’t tested this, but this is what I’m currently using for TopBarPlus, so I’m guessing it’s going to work.

Alternatively, you could do something like this for the functions:

	:bindEvent("selected", function(icon) -- tween in
		Frame.Visible = true
	end)
	:bindEvent("deselected", function(icon) -- tween out
		Frame.Visible = false
	end)

For the Local Variables:

local StarterGui = game.Players.LocalPlayer.PlayerGui:WaitForChild("Menu")
local Frame = StarterGui:WaitForChild("MenuFrame")

If you’re looking to toggle it, try doing this:


	:bindEvent("selected", function(icon) -- tween in
		if Frame.Visible == true then
                 Frame.Visible = false

	else
                 Frame.Visible = true
	end
	end)

You’ll need to change these to work, but this should get you on the right path, or at least give you an idea of how to make this work.

There might be issues with this as stated before, and I’m not a scripted so you might want to organize your code better than mine.

1 Like

I’ve also gone ahead and changed the topic name to TopBarPlus support. :slight_smile:

1 Like

Thanks, I think the way that is stated on the Documentation was for V2, so that’s why it didn’t work.

Awesome! One of my longest Development Supports posts yet.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.