Hello everyone, I’m trying to make a system where a transport schedule is given, and in this case the train needs to move between two servers, but the problem is that I have no ideas, because I still need to make sure that signals are sent between the servers, and so that this also works with empty servers. You can, of course, make the train move, for example, at 17:30 the CFrame moves, but the problem is that this is inconvenient and I prefer to use hings and body velocity. Does anyone have an idea how to make this system.
Sorry, I dont understand what you mean?
If the server is empty, is off, why would you need to get data inside a server which is empty? its not an active server it cant perform any action by itself…
I think you need to explain better what you mean
Okay, but how i can make a transport system between servers?
You gotta be more specific, by your explanation I understand only this:
Transportation system between servers? Then its a train where players get on board, the train start moving forward, and at some point you teleport all those players to a different server, I suppose you mean a different “map” which is inside your project file, meaning a new server.
Players arrives the new server, the train is spawned, players are placed in their respective seats, and the train keeps moving forward
You could save the players information on a datastore before leaving server A and upon server B starts, read that data to place the right train, the right player’s positions etc
Thats what you want? otherwise you need to be more clear
Yes, you said it right! )))))))
Sorry, I forgot to clarify that the train is leaving and is supposed to disappear. But after a while he comes back, and the cycle repeats. The problem is that it is unclear when the train will arrive back to upload to the server, because this train runs on physics, and not on CFrame
Thanks for the help, in general I thought a little and understood how it should work.
I still dont see an issue in there.
You push the train with MoverConstraints (physics), when it reach the “exit” point, you just save a datastore special for the train only, with all the player’s info you need, perhaps, the server ID from where is leaving, its speed, params you need, the model’s name of the train, etc then TeleportAsync() all players in it to the new server.
Upon server B starts, read the datastore of the train, collect and set all params needing, clone the train from ServerStorage, place the players that continue with the teleport (and didnt closed the game), expect for possible players that teleported with a delay so not all players could join at the same time, and thats it.
When the train reach the exit point again now on server B, repeat the process, save everything, destroy the train, teleport players to server A. Sounds not much complicated.
Actually the real problem I see, is:
If you have players in America that join server A, and other players join the game too in Asia, there is a big chance that roblox will create 2 servers A (maps). Each one close to the players in both continents.
Now, there is a chance that when the trains comes back from serverB to serverA, there is a chance that both trains loads into the same server A… Cause 2 trains exist at the same time, and roblox could decide to teleport all players to the same server.
Its only a chance, cause roblox will try to send the players to a closer server to them.
So, handling that a serverA or B do not contain 2 or more trains at the same time, you could require a system to handle that too
You can use the TeleportService
’s TeleportPartyAsync
to mass teleport the players. This also has the option to set teleport data which can be retrieved on the new server via Player:GetJoinData()
or using the TeleportService
’s GetLocalPlayerTeleportData()
function on the client. A DataStore should not be necessary here.
If a server is empty, it will close, unless it has just opened.