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
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?