local Gui = Instance.new("ScreenGui")
Gui.Name = "SpectateGui"
local Button = Instance.new("TextButton")
Button.BackgroundColor3 = Color3.fromRGB(1, 137, 255)
Button.BackgroundTransparency = 0
Button.Position = UDim2.new(0, 15, 1, -90)
Button.Size = UDim2.new(0, 190, 0, 20)
Button.Text = ({[false] = "Spectating", [true] = "Playing"})[Playing[Player]] .. ""
Button.Parent = Gui
Button.MouseButton1Click:connect(function()
Playing[Player] = not Playing[Player]
Button.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
Button.Text = ({[false] = "Spectating", [true] = "Playing"})[Playing[Player]] .. ""
end)
I have successfully made GUI with clickable button.
When I click it and it changes to "Spectating" and red color and when I want to start playing and I have to click button again to change it back to "Playing" but red color won't change back to blue color?

1 comment
Ahh, thanks you!