when I use the bindToggleItem it somehow does not work even if I follow the guides and tutorials it does not work. I cannot open a gui for some reason because I was going to update a game with a cool UI feature than my old one. Look at the code to see if something is wrong:
-- This retrieves the theme module under Icon
local iconModule = game:GetService("ReplicatedStorage").Icon
local Icon = require(iconModule)
local Themes = require(iconModule.Themes)
-- Retrieve the GUI from StarterGui
local gui = game:GetService("StarterGui"):WaitForChild("lol")
-- Create the icon
local topbarIcon = Icon.new()
:setImage(6326373239)
:setLabel("My Settings") -- Set your own label for the topbar icon
:setCaption("Custom Settings Caption")
:setTip("Open Settings (M)") -- Set your own tooltip text
:bindToggleKey(Enum.KeyCode.M)
:bindToggleItem(gui) -- Bind the GUI to the icon
:setProperty("deselectWhenOtherIconSelected", false)
:set("iconFont", Enum.Font.Arial) -- Set the font to Arial
:setRight()
:notify()
:setTheme(Themes.BlueGradient)
:bindEvent("selected", function(icon)
gui.Enabled = true -- Enable the GUI when the icon is selected
end)
:bindEvent("deselected", function(icon)
gui.Enabled = false -- Disable the GUI when the icon is deselected
end)
when I use the bindToggleItem it somehow does not work even if I follow the guides and tutorials it does not work. I cannot open a gui for some reason because I was going to update a game with a cool UI feature than my old one. Look at the code to see if something is wrong: -- This retrieves the theme module under Icon local iconModule = game:GetService("ReplicatedStorage").Icon local Icon = require(iconModule) local Themes = require(iconModule.Themes)
-- Retrieve the GUI from StarterGui local gui = game:GetService("StarterGui"):WaitForChild("lol")
-- Create the icon local topbarIcon = Icon.new() :setImage(6326373239) :setLabel("My Settings") -- Set your own label for the topbar icon :setCaption("Custom Settings Caption") :setTip("Open Settings (M)") -- Set your own tooltip text :bindToggleKey(Enum.KeyCode.M) :bindToggleItem(gui) -- Bind the GUI to the icon :setProperty("deselectWhenOtherIconSelected", false) :set("iconFont", Enum.Font.Arial) -- Set the font to Arial :setRight() :notify() :setTheme(Themes.BlueGradient) :bindEvent("selected", function(icon) gui.Enabled = true -- Enable the GUI when the icon is selected end) :bindEvent("deselected", function(icon) gui.Enabled = false -- Disable the GUI when the icon is deselected end)