How can I run code one time throught all servers?

I don’t know if I was clear at all on the title. I wanna do a live event on a game and when the timer ends, I want to send a signal to an external page (glitch.com) to do more stuff. The problem is that if there is more than 1 game server running on Roblox, the signal is sent the number of servers that are active, but I want it to be sent just once. I tried to do some stuff with MessagingService, but the only solution that comes to my mind is making a global variable for all servers and changing the value once the signal is sent, and then check from every server the variable to see if the signal has been already sent. Idk, just help plz lol

If you wanted to use an extremely simple solution, you could use os.time() to calculate when the event should start (I assume this is how you are already doing it), and then use a simple debounce on your glitch app to void any repeat requests.

I know this isn’t extremely ideal, but it is the best I could think of other than exploring MessagingService, which it seems you’ve already done.

I hope this helps!

1 Like