i am trying to make a Icon that changes when my value changes. [In this case used for music]
My issue is it is not changing/working.
Code
local Player = game:GetService("Players").LocalPlayer
local GroupId = 11587846
local rank = Player:GetRoleInGroup(GroupId)
local rankid = Player:GetRankInGroup(GroupId)
local player = game:GetService("Players").LocalPlayer
local playerGui = player.PlayerGui
local gui = playerGui:WaitForChild("settings")
local settings1 = gui.settings
local credits = playerGui:WaitForChild("credits").credits
local Icon = require(game:GetService("ReplicatedStorage").Icon)
local musicsong = workspace.currentsong.Value
local musicsong2 = workspace.currentsong
Icon.new()
:setName("Current-Song")
:setImage(7203694787)
:setMid()
:lock()
:setSize(100,32)
:bindEvent("deselected", musicsong:Changed:Connect(function(value)
Icon:setLabel(musicsong, "hovering")
Icon:setLabel(musicsong, "deselected")
Icon:setLabel(musicsong, "selected")
end))
I’m not lying (That will be illegal in devforum), Because I really don’t know what you want to do with this code.
Why you are calling setLabel in 3 times continus, And binding event to connect function, witch returns nil.
I think what part of what @dollychun is trying to say is that you are changing the icon 3 times without any wait, so that the end result is it almost instantly going to selected.