Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How come my GUI button wont change its text-color when clicked?

So I have a button that when clicked will change its color but for some reason, it won't change how come why?

--|Script|--

script.Parent.MouseButton1Click:Connect(function()
	script.Parent.Parent.Romans.TextColor3 = "255, 255, 255"
	script.Parent.TextColor3 = "12, 53, 0"
end)

--|locations|--

The script is located in a text button called Carthaginians and Romans is a text button located in a screen GUI along with the Carthaginians button.

P.S.

Sorry for the rushed question if you don't understand just tell me what you don't understand and I'll edit it, and or tell you.

2 answers

✓ Accepted answer

Wrong value, that's a string, it needs a Color3 value. Consider checking output next time. Here's an example of me assigning a variable a color3 value

Note I'm on mobile.

local a=Color3.fromRGB(255,0,255)

1 comment

0

Thanks for the help

TextColor3 takes in a Color3 and not a string what you want to set it to is actually

Color3.fromRGB(255, 255, 255)
-- like this
script.Parent.Parent.Romans.TextColor3 = Color3.fromRGB(255, 255, 255)

Roblox Wiki:

Color3

TextColor3

Don't forget to mark my answer as the solution if it solved your problem(Upvotes are also very much appreciated) :)

This discussion is preserved as it was. New answers, comments, and votes are closed.