Collapse Sidebar


This function sets the DataModel/PlaceId of the game instance to the given placeId.

Setting the DataModel/PlaceId is required to access the DataStoreService when the place is unpublished (for example a local .rbxl file). See below for an example. Note this will only work when the ‘Enable Studio Access to API Services` option is enabled under game settings.

local DataStoreService = game:GetService("DataStoreService")

-- access DataStore 'Data' as place placeId
local dataStore = DataStoreService:GetDataStore("Data")

You can use DataModel/SetUniverseId to set the DataModel/GameId of the game instance. However, it is the DataModel/PlaceId that must be set to access the DataStoreService.


Name Type Default Description

The ID to set the DataModel/PlaceId to


Return Type Summary