Change BubbleDieDuration for NPC chat bubbles

Hey,

so I made this script which makes my NPC “chat”.

local TextChatService = game:GetService("TextChatService")
local BubbleChatConfig = TextChatService.BubbleChatConfiguration

BubbleChatConfig.MaxDistance = 500
BubbleChatConfig.MinimizeDistance = 450

while wait(5) do
game:GetService("Chat"):Chat(script.Parent.Head, "Hey", Enum.ChatColor.White)
end

I got 2 problems:

  1. I want the bubbles to disappear slower, maybe around 10s per bubble, but at the same time I dont want to change this for the entire game, so player conversations would still be normal.
  2. The Distance changes I made at the top of the script should also only affect the NPC and not the entire game, is this possible somehow?

thanks

This should hopefully work for you, if you ever want me to try another message, feel free to send me a message saying you want that.

local TextChatService = game:GetService("TextChatService")
local BubbleChatConfig = TextChatService.BubbleChatConfiguration
local MaxDistance = BubbleChatConfig.MaxDistance
local MinimizeDistance = BubbleChatConfig.MinimizeDistance
local BubbleDuration = BubbleChatConfig.BubbleDuration

while wait(5) do
	BubbleChatConfig.MaxDistance = 500         --
	BubbleChatConfig.MinimizeDistance = 450    -- Set the values
	BubbleChatConfig.BubbleDuration = 10       --
    game:GetService("Chat"):Chat(script.Parent.Head, "Hey", Enum.ChatColor.White)
	BubbleChatConfig.MaxDistance = MaxDistance           --
	BubbleChatConfig.MinimizeDistance = MinimizeDistance -- Restore the default values
	BubbleChatConfig.BubbleDuration = BubbleDuration	  --
end

Hmm, I’d rather not use a while loop for every message sent. Thanks for the help though

Like I said, if you want me to try to find an alternative method, I’ll do that.