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

How do I communicate with other servers?

Asked by 4 years ago

So, I made two separate games, "Main" and "Wait" I'm working on the shop GUI but What I want to do is make a gun and take the purchased gun from the wait to the main how do I do this

0
Anyone :( newtec9 0 — 4y
0
may i ask is this two places or games tylergoatboy 82 — 4y
0
Btw i'm sure about this but at this time barely anyone is online so I would recomend 10 - 4 hrs earlier, thats if you have a different time zone to uk or usa FluffySheep46209 369 — 4y
0
if it is two places then I think data save would work if it is two games there is no good way to do that unless you have an outside source tylergoatboy 82 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

There actually is a good way to communicate between servers, not many people know how to use this.

You can research this on YouTube and I'm pretty sure someone has explained this service.

The service is... MessagingService!

You probably think this is for in-game messages to send messages to other people, but actually it's for messages (data) to be sent and retrieved from the same game, but other servers!

There are 2 methods.

  • PublishAsync()

  • SubscribeAsync()

PublishAsync() is to send messages from one server to the rest of the servers.

SubscribeAsync() is to retrieve messages from the single server that sent the data.

Keep in mind, when you PublishAsync() it is sent to ALL servers, not just a single server. So, you'll have to do some check statements (if then statements) to check if the messages qualify for the server or not. SubscribeAsync() is a listener event that waits for PublishAsync() to be called from one server. Read the documentation and API.


Hope this helped! Not many people use this to their advantage.


Extra Documentation + API

0
Its much easier to give him a youtube link, nevertheless good answer JesseSong 3916 — 4y
Ad

Answer this question