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

Having your name/tag a different color than your text color?

Asked by 7 years ago
Edited 7 years ago

Hi I have a custom chat gui in my game and when I chatted everything was fine. When I chatted it said [Owner] docrobloxman52: 'My text'. All of that was the same exact color. What I want to learn how to do is how to make the tag (i.e. [Owner]) and the text the same color but the name isn't. I'm not sure how to do this. I've tried this in the past with string.sub but it didn't work. If someone could help me or teach me how to do this that would be amazing! Here's a reference picture from Mad Games: http://http://imgur.com/a/fDQS7

1 answer

Log in to vote
1
Answered by 7 years ago
Edited 7 years ago

ROBLOX doesn't support setting different sections of a single GUI element to have different color; for text, anyway. Here's a workaround:

Create a frame, then put 3 separate TextLabel's in it. You then change the TextColor of each TextLabel respectively, change the text of the first one to the tag, the second to the player's name, and the third to the message they are sending. You can then position the frame after parenting it into your chat GUI, and it should work as expected.

Note that this method might need tweaking to fit your needs, and will require a lot of your chat script to be edited.

Ad

Answer this question