Showing message on join

Hi

How do I make this message show up once? It’s been spammed over and over. I want it to show when the player joins the game.

local function chat(message)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {Text = message, Color = Color3.fromRGB(74, 174, 65),Font = Enum.Font.Code})
end

local messages = {"Server: Welcome to $$ Beta Release v0.2. Please join our group & Discord to stay updated!"}

while true do
	wait(5)
	chat(messages[math.random(1, #messages)])
end

If this is a local script, simply

local function chat(message)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {Text = message, Color = Color3.fromRGB(74, 174, 65),Font = Enum.Font.Code})
end

local messages = {"Server: Welcome to $$ Beta Release v0.2. Please join our group & Discord to stay updated!"}

chat(messages[1])
1 Like

Ah, works now. Thank you so much!

You forgot to mark it as the solution.

1 Like