TextButton resets color on death

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)

Turn reset on spawn off on the gui

Is ResetOnDeath enabled?

ah ty I was looking for something similar in the textbutton but instead it’s in the gui

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.