My system chat script not working

So, I’m making a small game, then I want to make it so that if the owner joins, it will display a message in the ChatBox

After I understand a bit of code and put it in StarterPlayerScript, then I run the game, there is no error in the output, but the code doesn’t work

This is my code, should I use RemoteEvents? or is there another way?

local ownid = 603603461

game.Players.PlayerAdded:Connect(function(plr)
	if plr.UserId == ownid then
		game.StarterGui:SetCore("ChatMakeSystemMessage", {
			Text = "T";
		})
	end
end)
1 Like

Yes, you’ll need to use a remote to fire all the players that the owner joined.

Use :SetCore() on the client.

On the server , provide the Owner’s name as the argument in the FireAllClients event.

(Also, PlayerAdded works only on server).

3 Likes

PlayerAdded does not work in localscript,

Use a server script and whenever player is added, check if it equals to your owner id, then use a Remote Event and fire all the clients RemoteEvent:FireAllClients(); then make a localscript and listen for the remote event to be fired.

3 Likes

Thank you! The advice you two gave really worked