Topbar+ V3 Help showing or not showing

Hello I need help with my code for TopBar+ V3. Basically I have a top bar for my staff that shows a GUI, but I don’t want it to show to people that are not staff in a group with a certain rank.

Top bar image below:


Code:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local localPlayer = game:GetService("Players").LocalPlayer
local playerGui = localPlayer.PlayerGui
local gui = playerGui:WaitForChild("Staff")


-- Assuming the Icon module is inside ReplicatedStorage
local container = ReplicatedStorage:WaitForChild("Icon")
local Icon = require(container)

-- Function to handle button click for Category 1

Icon.new()
	:setLabel("Staff | Chat menu")
	:setLabel("Chat menu", "Selected")
	:setLabel("Chat menu", "Viewing")
	:modifyTheme({
		{"IconButton", "BackgroundColor3", Color3.fromRGB(255, 255, 255)},
		{"IconGradient", "Color", ColorSequence.new(Color3.fromRGB(238, 95, 0), Color3.fromRGB(255, 197, 0))},
		{"IconGradient", "Enabled", true}
	})

	:bindToggleItem(gui)
	:call(function(icon)
		gui.MouseButton1Click:Connect(function()
			-- Code to execute on click
			
		end)

		while true do
		task.wait(3)
		-- Code inside the loop
	end

	end)
BTW

Chat GPT helped

@ForeverHD

Thank you so much,

1 Like