How to create a welcome message / system message [NEW CHAT VERSION]

Hello :wave:

I am sorry in advanced if this is not the best tutorial, it is my first one here! Anyway, in this tutorial I will show you how to create system message, most commonly used for game welcome messages. So lets get started!

Step 1 (Setup):

Firstly, we have to create everything we need. Create the following in the listed locations.

RemoteEvent / UnreliableRemoteEvent โ†’ ReplicatedStorage
Script โ†’ ServerScriptService
LocalScript โ†’ StarterPlayerScripts / ReplicatedFirst

image


Step 2 (ServerScript):

Once that is complete, go into the ServerScript and use this code:

local JoinMessageEvent = game.ReplicatedStorage:WaitForChild("JoinMessage")

game.Players.PlayerAdded:Connect(function(plr)
	JoinMessageEvent:FireAllClients(plr)
end)

I will now try and explain this script!

  • At the top of the script, we will define the RemoteEvent we created in ReplicatedStorage. We will then fire the RemoteEvent when a player joins the game.

Step 3 (LocalScript):

We will now pick up on the client when we fire the RemoteEvent. We will do this by using this script.

local JoinMessageEvent = game.ReplicatedStorage:WaitForChild("JoinMessage")
local TextChatService = game:GetService("TextChatService")

JoinMessageEvent.OnClientEvent:Connect(function(plr)
	task.wait(3)
	TextChatService.TextChannels.RBXSystem:DisplaySystemMessage(
		"<b> <font color='#FFFFFF'>๐Ÿ‘‹ Welcome</font> <font color='#FF8187'>" .. plr.Name.. "</font> </b>"
	)
end)
  • This may be a bit confusing, so I will explain.
    To change the font, font color and size etc we use Robloxโ€™s Rich Text Markup. When you start to read the docs page I linked you will get to understand how the tags work. There pretty simple when you have a read! (If you need any support on making custom messages feel free to leave a comment).

Once all these steps have been followed you will get something like that in the chat when a player joins.
image


If you would like to change the Players Name on the message to the Players DisplayName you can change this line of code in the LocalScript:

  • "<b> <font color='#FFFFFF'>๐Ÿ‘‹ Welcome</font> <font color='#FF8187'>" .. plr.DisplayName.. "</font> </b>"

Any question or problems please leave them in the comments and I will try and help you as quickly as I can. There is probably so many different ways of doing this, and I bet there is some better ways too, but at the moment this is all I can provide. Hope this tutorial comes across to users well and hope it is easy enough to understand.

Cheers :slightly_smiling_face:

11 Likes

Just curious but is there a reason for using the remote event instead of just directly having the PlayerAdded event in the client script?

I donโ€™t think this is true lolll.

I just noticed too :skull: it was a very different type of function when I used that type of system

Hey!

When I was making it for my game it didnโ€™t work when I put it in a local script for some reason. I am just trying it again and it does not do anything when someone joins so I just did it this way.

As I said, there is probably lots of better ways of doing it :slight_smile:
(Sorry if this was not the answer you was looking for lol)

Thanks for the scripting help! :slight_smile: u thought to help others is only fine :slight_smile:

1 Like

The server and the use of remotes doesnโ€™t need to be involved at all for something like this. The client knows when new players join!

This is the fixed script:

-- client:
local TCS = game:GetService("TextChatService")
local Channel = TCS:WaitForChild("TextChannels").RBXSystem

game.Players.PlayerAdded:Connect(function(player)
    Channel:DisplaySystemMessage("<b>Welcome, <font color='#FF8187'>" .. player.DisplayName .. "</font>!</b>")
end)

Yes this is what I had before when I tried itโ€ฆ
It does not work. It does nothing when a player joins thew game it does nothing

Ok I see what you mean. The reason why this does not happen is because when the player joins, the event has already fired. However, if any other player joins after that, the chat message to pop up. To fix this, just simply make the chat message pop up at the beginning of the script like this:

-- client:
local TCS = game:GetService("TextChatService")
local Channel = TCS:WaitForChild("TextChannels").RBXSystem

Channel:DisplaySystemMessage("<b>Welcome, <font color='#FF8187'>" .. player.DisplayName .. "</font>!</b>")

game.Players.PlayerAdded:Connect(function(player)
    Channel:DisplaySystemMessage("<b>Welcome, <font color='#FF8187'>" .. player.DisplayName .. "</font>!</b>")
end)
1 Like

Ah right cheers I did not know this! :slight_smile:

When I was making it I knew there was a way to do it just on the client, but I could just not think last night haha. Thanks!

Is this just seen by the client? Thanks

Nope,
All players will receive the chat message!