Hello! I am making a mute music button for a project im making, but I faced a problem where when you mute the music and reset, it switches to the unmuted color even though the music is muted. How do I make it so if you reset it stays the same color as it was before death?
Video:
-- script is a localscript located in the textbutton
local mutebutton = script.Parent
local players = game:GetService("Players")
local mute = game.ReplicatedStorage.mute -- bindableevent
local hum = players.LocalPlayer.Character:WaitForChild("Humanoid")
mutebutton.MouseButton1Down:Connect(function()
if mutebutton.TextColor3 == Color3.fromRGB(0,255,0) then
mutebutton.TextColor3 = Color3.fromRGB(255,0,0)
else
mutebutton.TextColor3 = Color3.fromRGB(0,255,0)
end
mute:Fire()
print("mute button clicked!")
end)