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

How do i change the color of color3 using scripts?

I'm making a whiteboard for a classroom with a question and some answers, so when they click an answer, the text will change to green if its right, and red if it's wrong. Here's what i have:

`function onClicked()

game.Workspace.Whiteboard.Answer2.TextColor3 = (121, 243, 0)

end

script.Parent.ClickDetector.MouseClick:connect(onClicked)`


Yes i have a clickdetector inserted into the textbutton, but nothing happens when i click on the answer! Could someone please help me fix this? And i don't know much about scripting.

2 answers

game.Workspace.Whiteboard.Answer2.TextColor3 = Color3.fromRGB(121, 243, 0)

or

game.Workspace.Whiteboard.Answer2.TextColor3 = Color3.new(121/255, 243/255, 0)

Also check your output. It shows errors that could help you solve your problem.

Also, :connect is deprecated (from my understanding), start using :Connect

You also started the script with `, is that correct?

5 comments

0

:connect still works though

0

Yea, I know. It's just "more correct" to use :Connect

0

You need to use Color3.fromRGB () to use values from 0-255. Color3.new() only takes values from 0-1

0

Oh, yea.

0

Thought I should point that out xD

I used the 1st method and the 2nd method, but they're not working. No i didn't put `, in my script, i tried :Connect instead of :connect, and no errors are in my output. I don't know what I'm doing wrong. I'm using a surfaceGUI & two textbuttons.

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