How to fire a function from another server using datastores?

I want a server to be able to fire a function in all the other servers. I know that this should be done using datastores, But I dont know how exactly to do this. How can i make one server fire a function for all the other servers?

I would create a Trello board and make all data save there, then you can pull data from the Trello board when you’re in a server.

I can’t give you an exact script, but that should work fairly well.

I would use DataStore:OnUpdate(Key,Function). From my experience, you may get anywhere between a 2 and 30 second delay in other servers, and there is a much more restrictive limit on calls. You could call the function using :SetAsync(Key,Value), :IncrementAsync(Key,Value), or :UpdateAsync(Key,Function).

4 Likes

I didn’t know that method existed :wink:

How new is it?

I swear that didn’t used to be there.

3 Likes

AFAIK it was shipped with the launch of DataStores. The applications are much more limited though compared to functions like :GetAsync().

4 Likes

Belated response here, but Ima post anyways. I would suggest not using this idea. This would mean polling a board for information, which is not the best method if an event based method like datastore’s :OnUpdate() exist. In addition you’re now relying on ROBLOX & Trello to be running fine. While this could work fine for a small project, production games with mid-large size playerbases could be harmed by any blips across both companies’ infrastructure. In addition, polling can bring ratelimit issues as you are now ratelimtied based on all game servers instead of per-game server. Just my opinion on the matter, in the end it’s up the developer to make an informed decision.

1 Like