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 3 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 — 3y

2 answers

Log in to vote
1
Answered by
Raccoonyz 1092 Donator Moderation Voter
3 years ago
Edited 3 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 — 3y
0
didnt work topsporter2007 -4 — 3y
0
Are you sure you are using it correctly? It should be a local script in a TextLabel. Raccoonyz 1092 — 3y
0
wait a local script? topsporter2007 -4 — 3y
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 — 3y
0
doesnt work topsporter2007 -4 — 3y
0
You aren't on the client - you are on the server. It says Current: Server. Raccoonyz 1092 — 3y
0
lol im so dumb topsporter2007 -4 — 3y
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 — 3y
Ad
Log in to vote
0
Answered by
Omzure 94
3 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