title: How do I make a chat message appear when a player joins my game
body: <p>So I have looked all over the web for a script that makes it so that when anyone joins my Roblox game it displays a message in chat (for example: "Player has joined my game"). This is the best that I've found:</p>
  
  <pre><code>local Players = game:GetService("Players")
  function onPlayerAdded((player)
       game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
          Text = "Welcome to my game!";
          Color = Color3.new(255/255, 0/255, 0/255);
          Font = Enum.Font.SourceSansLight;
          FontSize = Enum.FontSize.Size24;
      })
  end)
  </code></pre>
  
  <p>My script is a LocalScript and it is in StarterGui.</p>
  
  <p>If the question is unclear, I mean like in Minecraft when a player joins a server it usually says "Player joined the game", and I want that in my Roblox game.</p>