Basically, what the title asks. Is there a way to retrieve the IDs for all places within an experience using a script?
I know about game.PlaceId
which gives the ID of the current place, but what about other places?
Basically, what the title asks. Is there a way to retrieve the IDs for all places within an experience using a script?
I know about game.PlaceId
which gives the ID of the current place, but what about other places?
what? what are you trying to do? you can get information on a game via place id but wdym getting the place id from a game?
In a script, I want to get all the places in an experience. Each place is assigned a unique number. I want to get all those numbers using a script. Can it be done? If not, I’ll put in a feature request.
What… could you possibly use that for?
My game teleports players from a lobby to one of several game worlds depending on which map was selected. Since I’m using a different game for testing, I would like to be able to have the scripts in the place automatically determine what the place ID for the lobby is and teleport players to it.
I don’t see why it must be automatic
Because when I do an update to the actual game, I have to change the place IDs in every location. I’m trying to streamline the process. The only one that needs to be known everywhere is the lobby. The lobby has all the map information about which places have which maps. The lobby teleports the players to each place, but the place teleports them back when the round is finished.
Make or use a public/personal proxy request to the Roblox API to retrieve a list of Place IDs, of which are children of the “Universe”.
Use HTTPService
Make a request to the API that lists said information
Hope this points you in the right direction!
EDIT: Wrong URL lol
I would have to parse HTML to get that to work, and I’m not sure what URL I should be looking at. However, in the meantime, I was looking and I found AssetService:GetGamePlacesAsync which appears to be what I’m looking for.
An alternative that I thought about was to use memory stores. The lobby stores it’s own game.PlaceId
in a memory store and the other places get it that way. That might be better since the lobby itself is reporting it’s own place ID.
You want to make sure all of your Place Children are in the same Universe, GetGamePlacesAsync cannot get Places that are in other Universes
Or you could make a simple module that stores a table of PlaceIDs and publish it to the roblox Library (Being private of course). You can use :require(ASSET_ID)
to use the module without the need to insert it manually. This makes it so you can simply just overwrite the module with a new list once you make an update.