How to make chat bubble appear in npc?

I’ve seen countless of things like this and I’m getting pretty curious.
image
How the heck do they add chat bubbles above NPCs and make it seem like they talk? (This is an attacking npc btw so it’s not a regular npc that gives you quests and stuff.)

2 Likes

It uses the Chat service to make npcs talk with the :Chat() function. It’s basically just this:

local ChatService = game:GetService("Chat")
local NPC = workspace.NPC
if blah blah then
NPC:Chat(NPC,"HEY")
end

Chat (roblox.com)
Link to the full service.

1 Like

You could perhaps require chatservice

local ChatService = game:GetService("Chat")

local char = script.Parent
local Head = char.Head
ChatService:Chat(Head, "Hi there", "Red")
6 Likes

I see, is it for localscripts or serverscripts?

1 Like

It can be both, i believe. (characterlimit)

ModuleScripts can be required by both local and server scripts.

2 Likes

I meant the chatservice, but thanks anyways. :grinning_face_with_smiling_eyes:

1 Like

Ah, they used the language “require” which seemed a little off when referring to a service.

1 Like