TextChannel:DisplaySystemMessage() won't work

here’s the code:
btw both prints

-- Server
game:GetService("Players").PlayerAdded:Connect(function(player)
	print("Added")
	game:GetService("ReplicatedStorage").RemoteEvent:FireAllClients("Welcome ", player.Name)
end)

-- Client
local TextChatService = game:GetService("TextChatService")
local TextChannels = TextChatService:WaitForChild("TextChannels")
local RBXGeneral = TextChannels and TextChannels.RBXSystem

game:GetService("ReplicatedStorage").RemoteEvent.OnClientEvent:Connect(function(msg, playername)
	print("Hello?")
	RBXGeneral:DisplaySystemMessage(msg..playername)
end)
1 Like

For inscribing the the RBXGeneral and TextChannels variable, try using something like this:

local textChannels: Folder = textChatService:WaitForChild("TextChannels", 100) :: Folder
local generalChanel: TextChannel = textChannels:WaitForChild("RBXGeneral", 100) :: TextChannel

So your code should be ( client ):

local TextChatService = game:GetService("TextChatService")
local textChannels = TextChatService:WaitForChild("TextChannels")
local generalChanel = textChannels:WaitForChild("RBXGeneral")

game:GetService("ReplicatedStorage").RemoteEvent.OnClientEvent:Connect(function(msg, playername)
	print("Hello?")
	generalChanel:DisplaySystemMessage(msg..playername)
end)

uh btw how come this prints success?

-- Client
local TextChatService = game:GetService("TextChatService")
local TextChannels = TextChatService:WaitForChild("TextChannels")
local RBXGeneral = TextChannels and TextChannels.RBXSystem

game:GetService("ReplicatedStorage").RemoteEvent.OnClientEvent:Connect(function(msg, playername)
	print("Hello?")
	print(msg, playername)
	local Result = RBXGeneral:DisplaySystemMessage(msg..playername)
	print(Result.Status)
end)

image

1 Like

I assume whenever a ‘message’ is sent to a TextChannel it carries a ‘status’, which in your case it was Enum.TextChatMessageStatus.Success which means the message was delivered. Quite odd and I’m not quite sure why it’d print ‘success’.

Just make sure you have your ChatVersion on TextChatService:
image

And I’m not sure why you’re using
local RBXGeneral = TextChannels and TextChannels.RBXSystem.
Just use:

local textChannels = TextChatService:WaitForChild("TextChannels")
local generalChannel = textChannels:WaitForChild("RBXGeneral")

Do you really need a remote event for this? The client uses the PlayerAdded event too you know. No server script is needed for this.

i am so confused rn still doesn’t work Status prints Success btw

local TextChatService = game:GetService("TextChatService")
local TextChannels = TextChatService:WaitForChild("TextChannels")
local RBXGeneral = TextChannels:WaitForChild("RBXGeneral")

game:GetService("ReplicatedStorage").RemoteEvent.OnClientEvent:Connect(function(msg, playername)
	print("Hello?")
	print(msg, playername)
	local Result = RBXGeneral:DisplaySystemMessage(msg..playername)
	print(Result.Status)
end)

that’s not even the problem rn

Ok.

-- client:

game.Players.PlayerAdded:Connect(function(player)
    game.TextChatService.TextChannels.RBXGeneral:DisplaySystemMessage(`{player.Name} just joined the game.`)
end)

This is really all you need.

does that show to the other players?

Indeed it should display to other clients perfectly fine.

If you’re testing this in a solo place. Try adding a yield before firing to all clients, such as:

game:GetService("Players").PlayerAdded:Connect(function(player)
    task.wait(2)

    game:GetService("ReplicatedStorage").RemoteEvent:FireAllClients("Welcome ", player.Name)
end)

player added doesn’t even work on the client

game:GetService("Players").PlayerAdded:Connect(function()
	print("Client Player ADded")
end)

image

players.PlayerAdded does indeed work on the client. But you’re probably testing this in a solo place. Which means that the event loads in after the player joins, therefore the event doesn’t get fired for your own player. But for other players, it will display it.


OMGGGG FINALLY MAN! TSYM

1 Like

You should still avoid using a RemoteEvent, you don’t need it. The client will not fire PlayerAdded for itself though. But, why would one need a welcome message for theirself?

btw is there a way to customize the text? like changing the colors, font, etc

1 Like

There might be a way to but I’m not entirely sure how. You ‘might’ be able to use RichText however I’m not sure if it supports it. You can try though.

its just a test btw so don’t worry about it :slight_smile:

btw last question do you know how could i get the color of this?
image

1 Like

You mean how you can get the color of the label you’re circling? It seems to be b480ff in hexadecimal.