Hey, so I am designing an info board system which cycles through multiple “slides” of sort, with advertising, information, etc. The slides are progressed with an infinitely running loop. However, I also want to add a system to instantly display announcements to the board that admins type in through a GUI. They then would hit a button and a RemoteEvent:FireServer() occurs. Then, I want to stop the loop, show the announcement, then restart the loop. The loop is running in a Script. How could I do that? Do I need to use a different system without a infinitely running loop to perform this task? Thanks in advance.
Also, completely unrelated to the above, but how do you run the filter on text and display something if the text is moderated?
I think you should just inside the loop add a little .OnServerEvent() bit to whatever remote event is being fired that way you won’t have to break the loop. Also for text filtering here is the wiki on text filtering https://developer.roblox.com/en-us/articles/Text-and-Chat-Filtering
But if you really wanted to stop the loop you could just have two scripts where one which is running that infinite loop would just be disabled and then the other announcement script would be enabled with whatever data was being sent
You could add a debounce of sorts, this way we can prevent the loop from running by simply changing a set value.
local AnnouncementActive = false
while true do
if not AnnouncementActive then
end
end
Then we tie it all together by implementing a event detection to enable/disable the loop:
local AnnouncementActive = false
[event].OnServerEvent:Connect(function(player,text)
AnnouncementActive = true
-- Show announcement
end)
while true do
if not AnnouncementActive then
end
end
As for filtering text, here is an article regarding filtering text that you can learn from.
Alright, except I want it to immediately end the loop and jump straight into the announcement, instead of waiting for it to time out. I think I might go with trying @kom297 's solution, and if that doesn’t work, then I can try yours.