Making an NPC chat, with chat bubbles

Warning: I may be missing something obvious.

What I’m trying to do is make an NPC that can talk and comment like any player with ChatBubbles. I’ve tried using ChatSpeakers and things like that but it just doesn’t make chat bubbles. It appears in the chat window, but not as a ChatBubble. I’d really like to be able to have the ChatBubbles because it makes it more believable as a player. I’ve seen it done before, i just have no idea how. I’ve also combed the Forum but nothing seems to fit this exact problem… Any help?

SSS = game:GetService("ServerScriptService")
ChatServ = require(SSS:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
if not ChatServ:GetChannel("All") then
    while true do
        local ChannelName = ChatServ.ChannelAdded:Wait()
        if ChannelName == "All" then 
            break
        end
    end
end
local System = ChatServ:AddSpeaker("Frederick234")
System:JoinChannel("All")
System:SetExtraData("NameColor", Color3.fromRGB(255, 0, 0))
System:SetExtraData("ChatColor", Color3.fromRGB(255, 0, 0))


wait(30)
System:SayMessage("test", "All")

This is my current code, which makes text in the chat window and leaves no errors, but doesn’t make a chat bubble. Chat Bubbles are true in the settings in my place, and any normal user can make them.
image
frederick the silent

I’ve also heard it might just be that those other chat things I’ve seen are just well-made GUI replicas of actual ChatBubbles, but… I hope there might be another way cause that’s quite a lot of load time added per npc.

9 Likes

@tribalwo1f did you add a function to create a bubble message, from what I can see you dont have one and you dont appear to have bubble chat enabled. Bubble chat is a Gui within the player.

What kind of function would I use to make one?

pardon me, kindof a noob with chat sevice

I would take a look at this. Customizing In-Experience Text Chat | Documentation - Roblox Creator Hub

I read that, would’ve before posting, but I can’t find any functions that would create bubbles there.

image

In the game in while its running go to chat and copy the bubble chat script.

ok, are there functions to call in there or do I script one by forking?

Ok I have a script for you. @tribalwo1f

Use this as a template script.

local ChatService = game:GetService("Chat")

local part = Instance.new("Part")

part.Anchored = true

part.Parent = workspace

wait(3)

ChatService:Chat(part, "Blame John!", "Red")
15 Likes

It will give you this

1 Like

u can change the code into this:



SSS = game:GetService("ServerScriptService")
ChatServ = require(SSS:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
if not ChatServ:GetChannel("All") then
    while true do
        local ChannelName = ChatServ.ChannelAdded:Wait()
        if ChannelName == "All" then 
            break
        end
    end
end
local System = ChatServ:AddSpeaker("Frederick234")
System:JoinChannel("All")
System:SetExtraData("NameColor", Color3.fromRGB(255, 0, 0))
System:SetExtraData("ChatColor", Color3.fromRGB(255, 0, 0))


wait(30)
System:SayMessage("test", "All")

game.Chat:Chat(workpace.Frederick234.Head,'test',Enum.ChatColor.White) -- this line make the buble

5 Likes