Beginner Tutorial - How to make a Player Joined + Print Message

Disclamer: This is a Beginner Tutorial, DO NOT come running into the reply section shoving all your messages to me saying how this is the most basic thing ever.


Okay, now we got the Disclaimer out of the way, Hello! thanks for reading my Tutorial. This tutorial is very quick, this could take less than 5 minutes to do. Let’s not waste any more time, lol.

Section 1: Setting up.

First of, we need to set up where everything is going to be, make sure to have Explorer open.
click the + next to ‘ReplicatedStorage’ and add a little thing called ‘RemoteEvent’ rename this to ‘PlayerJoinedRE’

Second of all, click the + next to ‘ServerScriptService’ and add a ‘script’ rename this to ‘PlayerJoined’

Lastly, open the ‘StarterPlayer’ folder by clicking on the > icon near to the left of StarterPlayer, you should see two folders named ‘StarterCharacterScripts’ and ‘StarterPlayerScripts’. Click the + next to ‘StarterPlayerScripts’ and add a ‘Local Script’ rename this to ‘System Message + Print’.

Well done! We have set up the required resources to make this possible, this is what your Explorer should look like, if this doesn’t, please fix up the required, if it does, well done! moving on.

Section 2: Scripting.

In this part, you need to be more focused to make sure you don’t make any mistakes here. Go near ‘ServerScriptService’ and double-click the script named ‘PlayerJoined’. CTRL + A, Backspace everything and put this into the text.

game.Players.PlayerAdded:Connect(function(plr) -- Player Joins
	game.ReplicatedStorage.PlayerJoinedRE:FireAllClients(plr.Name) -- Fires Event.
end)

After this, go near ‘StarterPlayer’ > ‘StarterPlayerScripts’ and CTRL + A, Backspace everything and insert this code into the text.

game.ReplicatedStorage.PlayerJoinedRE.OnClientEvent:Connect(function(plrName) -- Connect Event
	
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
		Text = plrName .. " joined the game.", -- [Username] joined the game.
		Color = Color3.fromRGB(255, 0, 0), -- Click 'x, x, x' to change the color.
		Font = Enum.Font.SourceSansBold,
		TextSize = 18,
	})
	
	print(plrName .. " joined the game.") -- Prints out the game as Text.
end)

After all this, you’re all done! This should be the final product once you launch the game:

image

P.S Click F9 on your Keyboard or type in ‘/console’ to see the Developer Console.

Thank you for reading this over, I hope this helped you, please :heart: this post so more people see this, have a good day or night everybody!

15 Likes

This is a great tutorial, but there is another tutorial that already exists that goes in depth for making Join Messages AND Leave Messages.

2 Likes

I understand this, this is a updated and more easier tutorial.

I get FireServer and Other stuff but i never figured to ever use FireAllClients

Honestly it’s just a easier way to FireAllClients.

But when do you have to do that

When the Local Player joins the game.

I remember a youtube video about dont use FireAllClients until you have to if theres no choice soo could there be a different way to do this like FireServer oh wait you have to use FireAllClients for this part because theres no other way to ok

DISCLAIMER: This entire reply is my feedback and opinion on this tutorial. I mean to no offense to anyone.

The tutorial I linked is more descriptive and informative, since it goes more in-depth with the code so beginners who read the tutorial can learn from it.

My feedback is to go more in depth on what the code does. A few comments in the code won’t help beginners learn anything.

I hope this helped :slightly_smiling_face:

2 Likes

Isn’t this better to do the ‘PlayerAdded’ on Client, other than using RemoteEvent?

1 Like

Okay okay the reason why she used remote events is because of something called player notifi and i dont think theres another way to do it

If you’re using ChatMakeSystemMessage like in this tutorial, yes, you’ll need a RemoteEvent.

You could put it all in one server script, but you can’t customize the text color, font, and size like you can do with ChatMakeSystemMessage.

Sample script of what I mean:


local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")

local ChatServiceRunner = ServerScriptService:WaitForChild("ChatServiceRunner")
local ChatService = require(ChatServiceRunner.ChatService)
local allChannel = ChatService:GetChannel("All")

local function playerAdded(player)
	allChannel:SendSystemMessage("{System}: " .. player.Name .. " has joined the game.")
end

Players.PlayerAdded:Connect(playerAdded)

As you can see, the only thing you can customize is the join message itself. You can’t customize the text though.

That’s why most people use ChatMakeSystemMessage for Join and Leave messages. The text is customizable with ChatMakeSystemMessage.

2 Likes

Here’s the code in LocalScript;

local plrs = game:GetService("Players")
local StarterGui = game:GetService("StarterGui")

plrs.PlayerAdded:Connect(function(plr)
	StarterGui:SetCore("ChatMakeSystemMessage", {
		Text = plr.Name .. " joined the game.", -- [Username] joined the game.
		Color = Color3.fromRGB(255, 0, 0), -- Click 'x, x, x' to change the color.
		Font = Enum.Font.SourceSansBold,
		TextSize = 18,
	})
	
	print(plr.Name .. " joined the game.") -- Prints out the game as Text.
end)

1 Like