i wanna make a gamepass needed when we touch button on dropdowns or leaderstats value like tsb
but when i make like this
local Topbar = require(game.ReplicatedStorage.Icon)
local Cosmetics = Topbar.new()
Cosmetics:setDropdown({
Topbar.new()
:setLabel("Cosmetics")
i wanna make when the value on leader stats not enough to get cosmetics it will pop up the marketplace and the icon not being selected , its still pressed but when the value not enough it will not selected
TopbarPlus forked the default roblox healthbar and disables it on runtime. Due to this the script can move the healthbar next to the topbar icons on the right side, but this can indeed lead to some weird bugs when f. E. the healthbar gets re-enabled.
Hi
Small bug I found: when creating an icon while the chat is disabled (using StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)), and enabling the chat afterwards, the chat button is in front of the created icon’s button:
Solution for me is to wait until the chat is unhidden (it’s hidden for the loading screen on join), and afterwards create the button:
repeat
task.wait(1)
until StarterGui:GetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
Ideally the button would react to changes in the chat’s enabled state, and move aside.
hey everyone, I was just having some issues with Topbar plus functions. I have two buttons, one of which is a music mute button that toggles on/off. The other, is a basic InviteFriends button that opens the Roblox friend invite panel. Here’s the issue:
When the player toggles the music to the mute status, and afterwards clicks the Invite Friends button, then the music player gets unmuted and the user starts hearing the music again… Things I’ve tried:
Separating the two buttons into different local scripts
Please review my code below and see if you can help me out… Thanks!
local Themes = require(game:GetService("ReplicatedStorage").Icon.Themes)
local FindServerAudio = game:GetService("Workspace"):WaitForChild("ServerMusic")
local SocialService = game:GetService("SocialService")
local plr = script.Parent.Parent
local player = plr
local invite = Icon.new() -- INVITE FRIENDS
invite:setRight()
invite:setName("InviteFriends")
invite:setTheme(Themes.NoSelect)
invite:setImage("http://www.roblox.com/asset/?id=14277545872")
invite:bindEvent("selected", function(icon)
local canInvite = SocialService:CanSendGameInviteAsync(player)
if canInvite then
SocialService:PromptGameInvite(player)
end
end)
wait(.1)
local music = Icon.new() -- SERVER MUSIC TOGGLE
music:setName("ServerMusic")
music:setTheme(Themes.NoSelect)
music:setImage("http://www.roblox.com/asset/?id=14205184964")
music:bindEvent("selected", function(icon) --SET TO MUTE
icon:setImage("http://www.roblox.com/asset/?id=14205186156")
FindServerAudio.Volume = 0
end)
music:bindEvent("deselected", function(icon) --SET TO MUTE
icon:setImage("http://www.roblox.com/asset/?id=14205184964")
FindServerAudio.Volume = 1.2
end)
Hello everyone, I am having a hard time trying to realize how to notify icon in different script when (in my case) a crate was unboxed, can you please help me out with this
EDIT: Found a way, IconController - TopbarPlus
The reason it didnt work before because I didn’t set the name to my icon
local Themes = require(game.ReplicatedStorage.Icon.Themes)
local FindServerAudio = game:GetService("Workspace"):WaitForChild("ServerMusic")
local SocialService = game:GetService("SocialService")
local plr = script.Parent.Parent
local player = plr
local invite = Icon.new() -- INVITE FRIENDS
invite:setRight()
invite:setName("InviteFriends")
invite:setTheme(Themes.NoSelect)
invite:setImage("http://www.roblox.com/asset/?id=14277545872")
invite:bindEvent("selected", function(icon)
local canInvite = SocialService:CanSendGameInviteAsync(player)
if canInvite then
SocialService:PromptGameInvite(player)
end
end)
wait(.1)
local music = Icon.new() -- SERVER MUSIC TOGGLE
music:setName("ServerMusic")
music:setTheme(Themes.NoSelect)
music:SetImage("http://www.roblox.com/asset/?id=14205186156", "selected")
music:SetImage("http://www.roblox.com/asset/?id=14205184964", "deselected")
music:bindEvent("toggled", function()
FindServerAudio.Volume = 0
else
FindServerAudio.Volume = 1.2
end)
Also I recommend following this tutorial so you don’t need to always repeat the icon: or something like that, instead, do:
Icon.new()
:setName("IconName")
:setLabel("Label")
--customize it
Hey, I went ahead and tried all of your suggestions. While they modernized and made the scripts more efficient, the original issue is still persisting.
Okay so, I tried doing a code with a LocalScript for deselect the Icon when a button is clicked. But it does this error: Players.OnlyJ0nathan.PlayerGui.Shop.Frame.Close.LocalScript:17: attempt to index boolean with 'deselect'
Is there something wrong I did? My code is posted below so anyone can help me fix this out. Thanks!
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local PlayerUI = Player.PlayerGui
local Shop = PlayerUI.Shop
local Button = script.Parent
local Icon = require(ReplicatedStorage.Icon)
local IconController = require(ReplicatedStorage.Icon.IconController)
local icon = IconController.getIcon("Shop")
Button.MouseButton1Click:Connect(function()
Shop.Enabled = false
icon:deselect()
end)
Yup, was driving me crazy. For me it occurs when toggling the visibility of the core UI / chat box.
Best I can tell, when LegacyTextChat is enabled, the core UI object is destroyed or fully hidden, which makes TopbarPlus slide its icons over. When TextChatService is enabled, the core UI object is only partially hidden, which makes TopbarPlus not slide over. The bug appears to occur when TopbarPlus assumes it slid over, when it didn’t.
How can I close/deselected the topbar icon when I click on the exit button? I want to make it so you can either press the icon, press G, or click on the “X” to close it. Thanks!