TextChatService player messages sometimes not sending

For some reason sometimes when players try to chat in my game using the latest TextChatService the message sends incorrectly and only the player can see the message like shown in the photo below
image

I’ve not made any scripts that effects player message sending. There is only 2 scripts that interact with server messages in the TextChat which are show below.

Script 1:

--// Services
local TextChatService = game:GetService("TextChatService")
local Players = game:GetService("Players")

--// Create a new TextChannel
local myChannel = TextChannel
myChannel.Name = "All"

--// Parent the channel to TextChatService
myChannel.Parent = TextChatService

--// Function to display system message
local function displaySystemMessage()
	if #Players:GetPlayers() < 2 then
		myChannel:DisplaySystemMessage("<font color='#FFBF00'>System: This game requires 2 or more players to start. Invite friends or wait for someone to join and then we can start</font>")
	end
end

--// Initial system message
displaySystemMessage()

--// Connect to PlayerAdded event
Players.PlayerAdded:Connect(function()
	displaySystemMessage()
end)

--// Connect to PlayerRemoving event
Players.PlayerRemoving:Connect(function()
	displaySystemMessage()
end)

Script 2:

	local levels = player:WaitForChild("Levels")

	if expValue.Value >= (50 * (levels.Value + 1)) then
		levels.Value = levels.Value + 1
		expValue.Value = 0
		local TextChatService = game:GetService("TextChatService")

		local service = game:GetService("MarketplaceService")
		--// Create a new TextChannel
		local myChannel = ("TextChannel")
		myChannel.Name = "All"

		--// Parent the channel to TextChatService
		myChannel.Parent = TextChatService
		if player.Name == player.DisplayName then
			myChannel:DisplaySystemMessage(`<font color='#f0b52b'>{"@".. player.Name .."has advanced to level ".. levels.Value}</font>`)
		else
			myChannel:DisplaySystemMessage(`<font color='#f0b52b'>{"@".. player.Name .." ("..player.DisplayName..") has advanced to level ".. levels.Value}</font>`)
		end

Does anyone know how to fix this?

1 Like

Update: I think I may have found a solution and once I can guarantee it works I will set it as the solution for anyone else facing the same issue. Here is the part of both scripts I changed

local myChannel = TextChatService.TextChannels.RBXGeneral

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.