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

SetPlaceId

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
game:SetPlaceId(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.

Parameters

Name Type Default Description

The ID to set the DataModel/PlaceId to

Returns

Return Type Summary