Whys my remote event to display a system message not working?

I have a remote event which is fired from server to the client to display a system message, but it doesn’t do anything. Any ideas why? (The local script is in starter player scripts)

Server:

local function onPromptPurchaseFinished(player, assetId, isPurchased)
						if isPurchased then
							local asset = MarketPlaceService:GetProductInfo(assetId)
							local leaderstats = player.leaderstats
							local donated = leaderstats.Donated
							local price = asset.PriceInRobux
							donated.Value += asset.PriceInRobux
							
							local name = player.Name
							local Message = name .. " donated " .. price .. " robux to " .. winner.Name
							
							Remote:FireAllClients(player, Message)
						else
							print("Not Purchased")
						end
					end

Local:

local RS = game:GetService("ReplicatedStorage")
local Remote = RS.SystemMessage


Remote.OnClientEvent:Connect(function(Message: string)
	game.TextChatService.TextChannels.RBXGeneral:DisplaySystemMessage(Message)
end)

Have you tried printing before the event should fire in the server script to ensure it gets there. Printing where it should have fired in the local script to make sure it gets it. And tried running that line in the function by itself to make sure both the local script is actually running and the line is having the desired effect by itself?

1 Like

Ill try that now thanks

fgdgdfgdf

1 Like

Yeah it’s not firing for some reason, I just put this bit of code in an empty script that has no requirements and the print statement in the local script never printed.

local Message = "Server balha hfgbsdj"

Remote:FireAllClients(player, Message)

Just realised player shouldn’t be an arguement, so removed and tested but still not working

If you fire all clients you don’t need to send the player. So replace FireAllClients with FireClient

Remote:FireClient(player, Message)

1 Like

Thanks, but I realised that and just switched to only sending Message. But still not working weirdly

1 Like

Maybe the scripts want to set the remote controls while they don’t exist yet

local Remote = RS:WaitForChild(“SystemMessage”)

1 Like

Still no luck weirdly not really sure whats going on

1 Like

All I can suggest is that you do the following:

local Remote : RemoteEvent = RS.SystemMessage

This should give you an idea where something went wrong, as shown under red lines.

1 Like

Error: ‘TextChannels is not a valid member of TextChatService “TextChatService”’

When you start the game, can you see this? (Image below)
Otherwise you might have to do this

TextChatService:WaitForChild(“TextChannels”)

RobloxStudioBeta_ricyJXl3VP

1 Like

Infinite yield possible on 'TextChatService:WaitForChild(“TextChannels”)

Edit: I saw something about roblox updated the text chat system although that was about 2 years ago, I don’t know if this method it outdated maybe?

1 Like

Try this on top of your server script

local Channels = Instance.new("Folder", game.TextChatService)
Channels.Name = "TextChannels"
local RBXSystemChannel = Instance.new("TextChannel", Channels)
RBXSystemChannel.Name = "RBXSystem"
1 Like

Like this? If so then still no luck

local RS = game:GetService("ReplicatedStorage")
local Remote = RS.SystemChat

local Channels = Instance.new("Folder", game.TextChatService)
Channels.Name = "TextChannels"
local RBXSystemChannel = Instance.new("TextChannel", Channels)
RBXSystemChannel.Name = "RBXSystem"

Remote.OnClientEvent:Connect(function(Message)
	print("Called")
	print(Message)
	game.TextChatService.TextChannels.RBXGeneral:DisplaySystemMessage(Message)
end)
1 Like

No in your server script that is the client script

1 Like

Its print statements are working now which is good but still getting an error message:

RBXGeneral is not a valid member of Folder “TextChatService.TextChannels”

Current code:
Server:

-- // SERVICES
local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")

local Remote : RemoteEvent = RS.SystemChat

local Channels = Instance.new("Folder", game.TextChatService)
Channels.Name = "TextChannels"
local RBXSystemChannel = Instance.new("TextChannel", Channels)
RBXSystemChannel.Name = "RBXSystem"

game.Players.PlayerAdded:Connect(function(player) 
	player.CharacterAdded:Connect(function(character)
		local ff = Instance.new("ForceField")
		ff.Parent = character
		ff.Visible = false
		
		local Message = "Server balha hfgbsdj"

		Remote:FireAllClients(Message)
		
	end)
end)

Client:

local RS = game:GetService("ReplicatedStorage")
local Remote = RS.SystemChat

Remote.OnClientEvent:Connect(function(Message)
	print("Called")
	print(Message)
	game.TextChatService:WaitForChild("TextChannels").RBXGeneral:DisplaySystemMessage(Message)
end)

1 Like

Im sorry

RBXSystemChannel.Name = "RBXGeneral"
1 Like

Thank you very much for your help, I really appreciate it. Just got this error:

TextChatService is not enabled. Check TextChatService.ChatVersion and make sure it is not set as ChatVersion.LegacyChatService.

1 Like

So the solution is to set the chat version of LegacyChatService to TextChatService?

1 Like

Ah yeah , never used it before so had no idea where to find it but just found it, thank you very much for your help :slight_smile:

1 Like