How would I tween the background color of a UI Element?

I’m making a button that lets the player join and leave a que, and I want to make it so that when the button is clicked and they want to join, it goes from green to red and the text changes to leave. How would I do this?

Roblox allows you to tween Color3 values so you can use Tweenservice for that: TweenService | Roblox Creator Documentation
You can change the text by just doing this: GUI.Text = "Something"
Then, to detect when the button is clicked:

script.Parent.MouseButton1Click:Connect(function()
	-- add the tween and the text change all in here.
end)
1 Like

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