Skinstashery
Roblox
Home / Roblox / Studio script library / Chat welcome message
RB-004

Roblox chat welcome message script

Shows a welcome line in the chat window when a player joins.

Script type
LocalScript
Where it goes
StarterPlayer > StarterPlayerScripts
Category
GUI

For your own game in Roblox Studio. Not for use in other people's games.

The code

-- Chat welcome message: a system line in the chat window, shown only to this player.

local MESSAGE = "Welcome to my game! Have fun."

local TextChatService = game:GetService("TextChatService")
local StarterGui = game:GetService("StarterGui")

if TextChatService.ChatVersion == Enum.ChatVersion.TextChatService then
	-- New chat system (the default for new games).
	local channels = TextChatService:WaitForChild("TextChannels", 10)
	local general = channels and channels:WaitForChild("RBXGeneral", 10)
	if general then
		general:DisplaySystemMessage(MESSAGE)
	end
else
	-- Old chat system. The chat may need a moment to load, so try a few times.
	for _ = 1, 10 do
		local ok = pcall(function()
			StarterGui:SetCore("ChatMakeSystemMessage", {
				Text = MESSAGE,
				Color = Color3.fromRGB(255, 220, 80),
			})
		end)
		if ok then
			break
		end
		task.wait(1)
	end
end

How to set it up

  1. Open StarterPlayer, then StarterPlayerScripts.
  2. Add a LocalScript there and paste the code.
  3. Change MESSAGE to your own welcome text.
  4. Play and open the chat window (the speech bubble icon, top left). The message is there.

Change it

More in GUI

All Roblox scripts

More Roblox tools