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!