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

A persons name is a color in a custom chat?

Asked by 11 years ago

How do you have a persons name that is a certain type of color. Below is the script!

01function UpdateOldLabels(Parent)
02    for i,v in pairs(Parent:GetChildren()) do
03        if v.Name:sub(1,4):lower() == "line" then
04            local LineNumber = v.Name:sub(5)
05            if LineNumber == "12" then
06                v:Destroy()
07            else
08                v.Name = "line"..tostring(tonumber(LineNumber) + 1)
09                v.Position = v.Position - UDim2.new(0,0,0,15)
10            end
11        end
12    end
13end
14 
15game:GetService("Players").PlayerAdded:connect(function(player)
View all 37 lines...
0
What color do you want it to be? A random color? TheGuyWithAShortName 673 — 11y
0
Like say I want my name to be Red and your name to be Blue. I want colors to certain people on ROBLOX EmperorF 0 — 11y

3 answers

Log in to vote
0
Answered by 11 years ago

You would need to adapt this script to use two TextLabels; one for the name, and one for the message. Unless you would like the message and the name to be the same colour.

01function UpdateOldLabels(Parent)
02    for i,v in pairs(Parent:GetChildren()) do
03        if v.Name:sub(1,4):lower() == "line" then
04            local LineNumber = v.Name:sub(5)
05            if LineNumber == "12" then
06                v:Destroy()
07            else
08                v.Name = "line"..tostring(tonumber(LineNumber) + 1)
09                v.Position = v.Position - UDim2.new(0,0,0,15)
10            end
11        end
12    end
13end
14 
15game:GetService("Players").PlayerAdded:connect(function(player)
View all 51 lines...

Untested, may or may not work.

0
I just want the name to be a color EmperorF 0 — 11y
0
The code that I added should function. Articulating 1335 — 11y
Ad
Log in to vote
0
Answered by 11 years ago
1newchatline.TextColor3 = player.TeamColor.Color

Try changing that to this:

1newchatline.TextColor3 = player.Name=="EmperorF" and BrickColor.new("Bright red").Color or BrickColor.new("Bright blue").Color

It's not guaranteed that this will work, but I think it will. Let me know if anything goes wrong.

0
Mk, I'll try it tommorrow to see if it works. Thanks a lot you helped me a ton EmperorF 0 — 11y
0
This isn't what the asker was requesting. They stated that they wanted the name to be one colour and the message to be another. Articulating 1335 — 11y
Log in to vote
-1
Answered by 11 years ago

Is the script in ServerScriptService? If not it needs to be in there.

Answer this question