Joing message not working correctly

Hello all! I have an error in my code, the join only works for me.
I would like it to show something in the chat every time another player joins the game. Here is the code:

game.StarterGui:SetCore("ChatMakeSystemMessage", {
	Text = "[Server] "..player.." joined the game!";
	Color = Color3.new(1, 1, 1);
	Font = Enum.Font.SourceSansBold;
	FontSize = Enum.FontSize.Size24;
})

You should consider using RemoteEvents.

SERVER SCRIPT

function onPlayerAdded(plr)
 RemoteEvent:FireAllClient(plr)
end

LOCAL SCRIPT

function onRemoteEvent(plr)
game.StarterGui:SetCore("ChatMakeSystemMessage", {
	Text = "[Server] "..plr.." joined the game!";
	Color = Color3.new(1, 1, 1);
	Font = Enum.Font.SourceSansBold;
	FontSize = Enum.FontSize.Size24;
})

As that script you made will only show up for the player that joined.

By the way, in the Server Script it should be RemoteEvent:FireAllClients(plr) . You forgot the s.

You could use the Lua Chat System to make a message from the server that will display to all players instead of having to fire a RemoteEvent.

CreateMessage = function(text, color, font, size)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {
		Text = text;
		Color = color;
		Font = font;
		FontSize = size;
	})
end

if game:GetService("Workspace"):WaitForChild("Values"):WaitForChild("JoinsInitialized").Value == false then
	game:GetService("Workspace"):WaitForChild("Values"):WaitForChild("JoinsInitialized").Value = true
	CreateMessage(game:GetService("Players").LocalPlayer.Name.." has joined the game!", Color3.new(255/255, 230/255, 34/255), Enum.Font.SourceSans, Enum.FontSize.Size24)
end

game.Players.PlayerAdded:Connect(function(plr)
	CreateMessage(plr.Name.." has joined the game!", Color3.new(255/255, 230/255, 34/255), Enum.Font.SourceSans, Enum.FontSize.Size24)
end)

game.Players.PlayerRemoving:Connect(function(plr)
	CreateMessage(plr.Name.." has left the game!", Color3.new(255/255, 88/255, 88/255), Enum.Font.SourceSans, Enum.FontSize.Size24)
end)

Add this script, and you should be good to go! :smiley:

You are passing the Player instance into a string, which will probably error. You should pass the plr.Name value instead.

I am getting an infinite yield on The WaitForChild(“Values”).