Chat server message script not working

I want these things to be said in the chat as a server message, I put many duplicates then 1 that is not duplicated to make there be a low chance of the easter egg being messaged.
For some reason it won’t work.

local function chat(message)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {Text = message, Colour = Color3.fromRGB(7, 160, 255), Font = Enum.Font.SourceSansBold} )
end

local messages = {"Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Server: hi despacito i am bored"}
--{"Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like."}
while true do
	wait(math.random(5,10))
	chat(messages[math.random(1, #messages)])
end

Not sure if this is the problem, but Colour should be Color.

On the tutorial I used it said to put it as that, so I did. I’ll try it.

It did not work. Any other ideas?

Make sure this is a local script, this doesn’t work in server scripts.

It is a local script in starterplayerscripts.

Not sure, but try using task.wait() instead?

local function chat(message)
	game.StarterGui:SetCore("ChatMakeSystemMessage", {Text = message, Color = Color3.fromRGB(7, 160, 255), Font = Enum.Font.SourceSansBold} )
end

local messages = {"Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like.","Server: hi despacito i am bored"}
--{"Hint: Press 'Open Shop' to open the shop and get more guns for in game money.","Hint: There is a admin gamepass for 800 robux!","Server: Enjoying the game? Please give a like."}
while true do
	task.wait(math.random(5,10))
	chat(messages[math.random(1, #messages)])
end

Also, is this the whole script or is there more to it?

It’s the whole script. Could the issue be that I am using the beta chat system?

Is there any error in the output?

Nope. There is no error shown in the output.

Not sure what it is with yours, but it works fine for me.

Probably because of the beta chat system. I’ll try to turn it off.

Yes, the issue was that I was using TextChatService.