Making a player "Chat" to a NPC

Hi,

I’m working on a system to let players ‘chat’ with NPCs, and I want to make it look as close to the normal Roblox chat as possible.

I’m currently showing the chat using:

Chat:Chat(localPlayer.Character.Head, "Hello", "White")
StarterGui:SetCore("ChatMakeSystemMessage", { Text = "[" .. localPlayer.DisplayName .. "]: Hello"; Color = Color3.fromRGB(255, 255, 255); })

This puts the bubble chat over the players head, and shows a message (that only they will see) in the chat box
The only problem I have with this is that the player’s name is also shown in white, so it’s not 100% like the real chat
chat1

I was also looking at using ChatService, I can use that on the server to send a message from the player. The formatting of this is perfect, but it would be seen by all other players in the server, which I don’t want to happen.
chat2

Is there any way that I can get the correctly formatted message in the chat area, but still have it only seen by one player?

Thanks!

Yea, Luau chat system got Rich text enabled. Basically u format it the same way as HTTP. <font color="FF0000">USERNAME</font> The following text will show USERNAME text as red.

Thanks, if I do this I just see the tags in my message. I’ve seen some posts here that can fix this by forking and changing the core chat scripts. Is that the only option or am I missing some simple setting somewhere that enables rich text?

My bad. I dont know any ways to modify it without “Forking” the chat. If you can get the chat messages container, simply add a script that will change every TextLabel’s RichText to true.

1 Like

The ‘Dialog’ and ‘DialogChoice’ classes are specifically purposed for this.

1 Like

Thanks! That’s a good suggestion too, I have looked at those and I want to take more control over the look of the UI so they won’t work for me, but they would definitely have been the easier choice

Yes I’ve had to fork a couple of the chat scripts to enable Rich Text there, but now it’s working perfectly, thanks!