AutoSystemMessage does not loop/repeat

  1. What do you want to achieve? I have a script that makes system messages in the chat; e.g. “Welcome! Join our communications server for the latest updates!”

  2. What is the issue? The system does not repeat and only runs once then it’s done forever.

  3. What solutions have you tried so far? I have tried adding this code at the end but I believe it’s extremely vague.

What I tried adding at the end:

if game.StarterGui.AutoMessageSystem.RepeatEnabled.Value == true then
   repeat
end

Actual code:

game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
	Text = "[SYSTEM] Welcome to the hangout! Have a question/concern? Ask a Mod In-Training+!";
	Color = Color3.new(255, 255, 0);
	Font = Enum.Font.SourceSansBold;
	FontSize = Enum.FontSize.Size24;
})

wait(20)

game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
	Text = "[SYSTEM] Join the communications server to stay up-to-date with the latest information!";
	Color = Color3.new(255, 255, 0);
	Font = Enum.Font.SourceSansBold;
	FontSize = Enum.FontSize.Size24;
})

wait(20)

game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
	Text = "[SYSTEM] To occupy a vibe room, ask a Mod In-Training+ to open one for you!";
	Color = Color3.new(255, 255, 0);
	Font = Enum.Font.SourceSansBold;
	FontSize = Enum.FontSize.Size24;
})

wait(20)

The system works for sure, but I want it to repeat.

Please note that I have no experience in programming/scripting whatsoever, so you are going to have to bear with me here. Any help is appreciated. :smile:

That last paragraph makes it easier for me, so…

Basically, you want to use a loop function like this:

while wait(20) do

game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage", {
	Text = "[SYSTEM] Join the communications server to stay up-to-date with the latest information!";
	Color = Color3.new(255, 255, 0);
	Font = Enum.Font.SourceSansBold;
	FontSize = Enum.FontSize.Size24;
})

end
1 Like

What if I want numerous messages instead of only one?

Yeah, you could simply put all of it in the loop. I was just using one as an example.

Ah, alright - I see what I have to do. Thank you so much for the help, your response was marked as the solution! :smile: