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

how to make text on the text button to change color?

Asked by 4 years ago

hello i want the text on the textbutton to change color but it doesnt works script i use

while true do
    script.Parent.TextColor3 = Color3.new(85, 255, 0)
end
0
this is my first time scripting topsporter2007 -4 — 4y

2 answers

Log in to vote
1
Answered by
Raccoonyz 1092 Donator Moderation Voter
4 years ago
Edited 4 years ago

Color3.new takes values in the range from 0-1. What you want is to do Color3.fromRGB. Also, you don't need a while true do loop.

You can try this:

script.Parent.TextColor3 = Color3.fromRGB(85, 255, 0)
0
you beat me to it brokenVectors 525 — 4y
0
didnt work topsporter2007 -4 — 4y
0
Are you sure you are using it correctly? It should be a local script in a TextLabel. Raccoonyz 1092 — 4y
0
wait a local script? topsporter2007 -4 — 4y
View all comments (6 more)
0
Yes, LocalScripts should be used in StarterGui. Using Scripts is terribly bad practice as it controls what the client sees on the server, and there is a slight delay. brokenVectors 525 — 4y
0
doesnt work topsporter2007 -4 — 4y
0
You aren't on the client - you are on the server. It says Current: Server. Raccoonyz 1092 — 4y
0
lol im so dumb topsporter2007 -4 — 4y
0
No you aren't - we all make little mistakes. You won't believe how many times something I made didn't work because I made a very small mistake. Raccoonyz 1092 — 4y
Ad
Log in to vote
0
Answered by
Omzure 94
4 years ago

This worked i tested it in studio myself

while true do
    script.Parent.TextColor3 = Color3.fromRGB(85, 255, 0)
end

Answer this question