PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

GetGamePlacesAsync

Returns a StandardPages object which contains the name and placeId of places within the current ‘Game’ (otherwise known as a ‘Universe’).

Returns

Return Type Summary

Code Samples


AssetService:GetGamePlacesAsync1

The following code goes through each page of games in the universe and prints the Name and PlaceId.

local pages = game:GetService("AssetService"):GetGamePlacesAsync()
while true do
     for _,place in pairs(pages:GetCurrentPage()) do
          print("Name: " .. place.Name)
          print("PlaceId: " .. tostring(place.PlaceId))
     end
     if pages.IsFinished then
          -- we reached the last page of results
          break
     end
     pages:AdvanceToNextPageAsync()
end