Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i change the color of color3 using scripts?

Asked by 6 years ago
Edited 6 years ago

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

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
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?

0
:connect still works though cmgtotalyawesome 1418 — 6y
0
Yea, I know. It's just "more correct" to use :Connect DragonOfWar900 397 — 6y
0
You need to use Color3.fromRGB () to use values from 0-255. Color3.new() only takes values from 0-1 Impacthills 223 — 6y
0
Oh, yea. DragonOfWar900 397 — 6y
0
Thought I should point that out xD Impacthills 223 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

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.

Answer this question