Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Fire a RemoteEvent for all servers?

Asked by 3 years ago

Hi, I'm just wondering how I would fire a Remote Event on all servers? Like the impossible obby (I think) where you can pay robux to nuke all servers? Thanks.

2 answers

Log in to vote
2
Answered by
gskw 1046 Moderation Voter
3 years ago

The somewhat recently-added MessagingService would be useful for this:

https://developer.roblox.com/en-us/api-reference/class/MessagingService

A server Script would listen to events like this:

local messaging_service = game:GetService("MessagingService")
messaging_service:SubscribeAsync("nuke_all_servers", function(extra_data)
    print("Received nuke event!")
end)

Another server script could "fire" the nuke event like so (obviously not a useful example):

local messaging_service = game:GetService("MessagingService")
local extra_data = "yada yada"

messaging_service:PublishAsync("nuke_all_servers", extra_data)
Ad
Log in to vote
0
Answered by
Raccoonyz 1092 Donator Moderation Voter
3 years ago

Answer this question