Try removing this line and see if it works. And Topbar+ only works on the client by the way.
TopBarPlus+ only works with local scripts.
You should make a local script within StarterPlayer > StarterPlayerScripts.
Is it possible to add a Click sound?
You can make a custom theme and change the clickSoundId
.
Thanks for the bug report, this should be patched now:
Feel free to DM me again if any further issues persist.
Is there any way to make these only visible to certain members in a group?
Check if the user is in the group using player:IsInGroup(1234567)
, then if that returns true, create the icons.
ahh. thanks I’ll see if this works. Also my button wont open any gui’s after following the tut to the dot. Any advice?
You should try debugging, add some prints every line or so, for example print “Icon was clicked” at the top of the function that is supposed to run when the icon is clicked ect
nvrm i figured it out. ty though
I’m trying to make a leaderstats icon on the basis of what I’ve seen in the Playground uncopylocked place, but I’m getting an error every time.
The error:
The script:
local localPlayer = game:GetService("Players").LocalPlayer
local playerGui = localPlayer.PlayerGui
local replicatedStorage = game:GetService("ReplicatedStorage")
local iconModule = replicatedStorage.Icon
local Icon = require(iconModule)
local IconController = require(iconModule.IconController)
local Themes = require(iconModule.Themes)
task.spawn(function()
while true do
wait(10)
--game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
wait(10)
--game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
end
end)
--game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.All, false)
--game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
--game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, false)
Icon.new()
:setName("Coins")
:setRight()
:lock()
:setSize(100, 32)
:call(function(icon)
local NumberSpinner = require(replicatedStorage.NumberSpinner)
local labelSpinner = NumberSpinner.new()
icon:convertLabelToNumberSpinner(labelSpinner)
labelSpinner.Name = "LabelSpinner"
labelSpinner.Decimals = 3
labelSpinner.Duration = 0.25
while wait(0.5) do
labelSpinner.Value = localPlayer:WaitForChild("leaderstats"):WaitForChild("Coins").Value
end
end)
Finally it is here huh. Looks great to have so many interactable features with almost no restrictions. Good job on the module!
From now on, ping this account instead of @AridFights1. I don’t use that account anymore.
I have an issue
https://gyazo.com/d8d65f3b1bf1d4a4374dabfc9129545c
For some reason, my hide ui button triggers the mute button to unmute, why is this?
It doesn’t trigger it to mute, but why does it trigger it to unmute?
code:
local HideAllUisIcon = Icon.new()
HideAllUisIcon:setLabel("Hide UIs", "deselected")
HideAllUisIcon:setLabel("Show UIs", "selected")
HideAllUisIcon.selected:Connect(function()
ScreenGui.Enabled = false
if PlayerGui:FindFirstChild("AdminScreenGui") then
PlayerGui:FindFirstChild("AdminScreenGui").Enabled = false
end
end)
HideAllUisIcon.deselected:Connect(function()
ScreenGui.Enabled = true
if PlayerGui:FindFirstChild("AdminScreenGui") then
PlayerGui:FindFirstChild("AdminScreenGui").Enabled = true
end
end)
local Mute = Icon.new()
--Mute:lock()
Mute:setTheme(RedGradient)
Mute:setLabel("Mute", "deselected")
Mute:setLabel("Unmute", "selected")
Mute.selected:Connect(function()
for _, v in pairs(workspace.Audio:GetDescendants()) do
if v:IsA("Sound") then
v.Volume = 0
end
end
end)
Mute.deselected:Connect(function()
for _, v in pairs(workspace.Audio:GetDescendants()) do
if v:IsA("Sound") then
v.Volume = 1
end
end
end)
Try this
Can you add support for later added themes?
Something like this:
-- Require all children and return their references
local Themes = {}; local function AddTheme(Module)
if not Module:IsA("ModuleScript") then return end
Themes[Module.Name] = require(Module)
end
for _, Module in pairs(script:GetChildren()) do AddTheme(Module) end
script.ChildAdded:Connect(AddTheme)
return Themes
Is there a reason you add themes post runtime?
I have a “module” (just another LocalScript
) that adds it’s own Theme
. I wanna use this script in multiple places, but for update reasons I don’t want to move each part of it (the script itself, Theme
module and other folders) from all the different places, so the script moves everything from it’s children by itself.
The problem I’m thinking of is, on some places, I would have at least two scripts using Icon
handler and I can’t guarantee the script I mentioned will be the first one to require the handler (and move the Theme
in the right place before doing so).
Gotcha, instead of…
local Themes = require(ReplicatedStorage.Icon.Themes)
local customTheme = Themes["YOUR_THEME_NAME"]
IconController.setGameTheme(customTheme)
Try:
local themes = ReplicatedStorage.Icon.Themes
local customTheme = require(themes:WaitForChild("YOUR_THEME_NAME"))
IconController.setGameTheme(customTheme)
You don’t actually have to require the Themes module at all, neither does the theme need to be within the Themes module, you simply just have to pass a table (i.e. the theme) into IconController.setGameTheme
or icon:setTheme
Oh, cool! Didn’t know that, however that makes it much easier!