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

How do I make it where when a certain player chats their chat color is yellow?

Asked by
Jephi 42
8 years ago

I want to make it when people in the variable "devs" chat, their chat color becomes yellow instead of the standard white.

local devs = {"ProCon712","Jephi","Player1"}
local plr = game.Players.LocalPlayer

plr.Chatted:connect(function()
    if plr.Name == devs then
        plr:Chatted(
            plr:ChatColor = "yellow"
        )
    end
end)

This is what I have and it does not work.

2
It's not possible unless you're using a Custom Chat Gui. M39a9am3R 3210 — 8y
0
I've seen people do it before though? Jephi 42 — 8y
1
Those people you've seen do it before have developed their own Chat gui system. If you develop it yourself you can manipulate the chat colors. Otherwise you cannot. Goulstem 8144 — 8y
0
You can look here if you want to start making your own chat gui: http://wiki.roblox.com/index.php?title=Making_a_Pseudo_chat_GUI Goulstem 8144 — 8y
View all comments (3 more)
1
Actually, there is a way. SetCore. But then you will get a duplicate. Unless you disable the chat textbox. MessorAdmin 598 — 8y
0
All hail MessorAdmin Goulstem 8144 — 8y
0
#AllHailMessorAdmin MessorAdmin 598 — 8y

1 answer

Log in to vote
1
Answered by 8 years ago

Well, if you have seen a ROBLOX chat with custom colors, but otherwise the only way to make a chat have custom colors is making a custom chatUI. I know how to do that, I'm not saying these other users are not thinking, they are equally just as smart. But, none the less. Messor to the rescue! Using the** SetCore method ** in a LocalScriptcan make a player's chat different colors.

SetCore method: http://wiki.roblox.com/index.php?title=API:Class/StarterGui/SetCore Custom Chat: http://wiki.roblox.com/index.php?title=Making_a_Pseudo_chat_GUI

So here's a example directly from the Wiki. Although I will add some custom code to it. :)

Your function parameters are... Arg #1: String (Required) Arg #2: Variant (Required)

And of course your functions, for this one we will be using ChatMakeSystemMessage PointsNotificationsActive (boolean);
BadgesNotificationsActive (boolean);
ChatWindowSize (UDim2);
ChatWindowPosition (UDim2);
ChatBarDisabled (boolean);
ChatMakeSystemMessage (table);
SendNotification (table);
TopbarEnabled (boolean);

local nClr3 = function(Color)
    if BrickColor.new(Color)~="Gray" then
        return BrickColor.new(Color).Color
    else
        return Color3.new(0, 1, 1) -- Cyan or Color3.new(0, 255/255,  255/255)
    end
end

function nChat(Message, Color)
    game.StarterGui:SetCore("ChatMakeSystemMessage", {
        Text = Message; -- Required. Has to be a string!
        Color = nClr3(Color); -- Optional, defaults to white: Color3.new(255 / 255, 255 / 255, 243 / 255)
        Font = Enum.Font.SourceSans; -- Optional, defaults to Enum.Font.SourceSansBold
        FontSize = Enum.FontSize.Size24; -- Optional, defaults to Enum.FontSize.Size18
    })
end

So how I would go about making the function working is..

nChat("Hello world!", "Lime green")
Ad

Answer this question