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.
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.
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.
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:
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.
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
(Sorry if this was not the answer you was looking for lol)
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: