How to display a chat message?

It supposed to work and using Chat service for bubblechat is not outdated lol who said that?

Bubble Chat would appear for secs you can use ProximityPrompt or ClickDetector for it

local Rig = workspace.Rig
local ProximityPrompt = Rig.ProximityPrompt
local Chat = game:GetService("Chat")

ProximityPrompt.Triggerred:Connect(function()
Chat:Chat(Rig.Head, "Hello")
end)
1 Like

Literally everyone says it’s outdated and replaced by the method I used. Lol don’t you see the documentation?

Also I stated in the topic that it doesn’t work in a script as well. And, I also want it to work in run mode as I am using it to test an NPC system.

1 Like

Listen here, DO YOU also see the documentation?
You should be thankful that we’re trying to help you.

image

Where do you see, this method is outdated? Point me. I don’t see it.

I READED DOCUMENTATION TO ANSWER YOUR DUMB QUESTION. THERE’S NO DAMN SIGN IT’S OUTDATED. AND IT WORKS. PUT THIS DAMN CODE INSIDE COMMAND BAR WHILE PLAYTESTING, AND YOU’LL SEE YOUR STUPID NPC SAYS “HELLO”.

I’ve got really mad. If you read all documentations and you’re very smart, then don’t post here :person_shrugging:

Solve it by yourself.

1 Like

What are you so mad about? IIt seems I misworded that sentence. But anyways, roblox is recommending users to use TCS:DisplayBubble to move away from this going to be outdated service.

There is literally no need to be soo hyper about smthing ngl.

Lmao, chill out dude. seems like you also didn’t read my post. I want the npc to say that line in a script and not the command bar. Read the topic god damn it.

Also if you don’t have a solution to a question then just don’t even try to solve it. Literally it only leads to arguments.

2 Likes

have you tried in a game (not studio), because in my studio neither of the methods display anything but works fine in-game

1 Like

You said

I said

To proof this works. I don’t know what’s your problem. It works fine for me.

may we know Is your code run with normal script? or localscript?

I assume you put script directly in NPC rig and if it’s localscript it won’t run when it’s descendant of workspace.

and I am sure both Chat and DisplayBubble method will work fine.

:DisplayBubble only works on the client side, so you need a Script with RunContext set to Client if you are going to place it in workspace.

1 Like

Chat the service is deprecated.

I am using a server script.

I see, well why won’t chat:chat work then? Unless, that’s also client!?

Exactly.

Both are methods are client sided. You’ll need to run bot inside a LocalScript for them to work.

Are you sure? They used to work server sided previously.

So from what I’ve read about both functions and tested myself, Chat:Chat() should work on the server. Personally didn’t know that myself but hey I guess that’s good to know (even though it’s deprecated). However, TextChatService:DisplayBubble() is exclusive to the client and can only be executed from LocalScripts. This also means that bubble messages from DisplayBubble() will only be visible to client that is firing the function. If you want all players in the server to see the bubble messages using this method, you’ll need to use a RemoteEvent and fire it to all clients from the server and handle the request from the client by calling DisplayBubble().

Example:

-- Server
local ReplicatedStorage = game:GetService('ReplicatedStrorage')
local remote = ReplicatedStorage.RemoteEvent

local message = 'some message here'
local partOrCharacter = -- Whatever you're trying to display the message on.

remote:FireAllClients(partOrCharacter, message)
-- Client
local TextChatService = game:GetService('TextChatService')
local ReplicatedStorage = game:GetService('ReplicatedStrorage')
local remote = ReplicatedStorage:WaitForChild('RemoteEvent')

remote.OnClientEvent:Connect(function(partOrCharacter, message)
    TextChatService:DisplayBubble(partOrCharacter, message)
end)

Hope this helps!

3 Likes

Cool but not the answer. I want Chat:Chat to work on server. Ik it’s deprecated yet it shoudl work. But it doesnt.

What code are you currently using to call Chat()? As others have stated in this post, all you need for this function is the character’s head and the string message.

local Chat = game:GetService('Chat')
Chat:Chat(character.Head, 'Message content here.')

I am using literally that. It’s the most simple and logical code yet it fails to work.

Just tested again in studio with a server script and it worked fine. What is the script you’re using to call the function? If you post your code, maybe I can help you…

1 Like

Yes but I want it to work while running the game. Not playing.

Here’s a quote directly from the documentation for the Chat method:

Since dialogs are controlled by a LocalScript, you will not be able to see any dialogs created from this method unless you are running in Play Solo mode.

2 Likes

answered here How to make a System Chat Message using the new TextChatService

2 Likes