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

Can a place created with :CreatePlaceAsync() get its owner from a datastore?

Asked by 8 years ago

I have a universe that uses CreatePlaceAsync(). Everybody gets their own base created with CreatePlaceAsync(). It saves everybody's base in a datastore. When a script in a base realizes that their base it out of date, it will create a new base for the owner with CreatePlaceAsync() and overwrite their old base in the datastore with the new one. Simple enough? Here's where it gets tricky...

How does the server know who is the owner so that it can overwrite the owner's base value in the datastore? You might think to just use localplayer, but the bases allow access for multiple players. Which player is the owner? What if the owner isn't even in the game?

I need to know if there is an easy way to get the owner of the base from the situation I have presented. If there isn't, how might I set up a system with HTTP service that can accomplish this?

Answer this question