Chat welcome message!

Hello :wave:,

I am trying to make my game to display a welcome message in the game chat with this code:

local Event = game:GetService("ReplicatedStorage"):WaitForChild("PlayerJoined")
local PlayerService = game:GetService("Players")

Event.OnClientEvent:Connect(function(plr, CountryName)
	print("Test")
	game.StarterGui:SetCore("ChatMakeSystemMessage",{
		Text = "Welcome Bot: Hello " .. plr.DisplayName,
		Color = Color3.new(0, 1, 0.498039),
		Font =  Enum.Font.SciFi,
		TextSize = 18,
	})
end)

However when it runs it prints β€œTest” with no errors, but then nothing in chat.
Any help is appreciated!

Is the event PlayerJoined being fired?

I have this code in serverscriptservice

local PlayerService = game:GetService("Players")
local Event = game:GetService("ReplicatedStorage"):WaitForChild("PlayerJoined")
PlayerService.PlayerAdded:Connect(function(plr)
	Event:FireAllClients(plr)
end)

This function may be firing before the player joins, check that the player is fully loaded in before you send the request or check from the local script.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.