DataModel¶
The root of Roblox's parent-child hierarchy. Its direct children are services, such as Workspace and Lighting, that act as the fundamental components of a Roblox game.
Description¶
The Data Model (commonly known as game
after the global variable used to access it) is the root of Roblox's
parent-child hierarchy. Its direct children are services, such as
Workspace and Lighting, that act as the fundamental components
of a Roblox game.
Inheritance¶
Object → Instance → ServiceProvider → DataModel
Nova inheritance: Instance → ServiceProvider → DataModel
Properties¶
CreatorId Supported Property Describes the ID of the user or group that owns the place.
This property describes the ID of the user or group that owns the place.
If the DataModel.CreatorType property is User then CreatorId
will be the Player.UserId of the place's owner. If the
DataModel.CreatorType is Group then CreatorId will be the ID
of the group that owns the place.
CreatorType Supported Property Describes the CreatorType of the place, whether the place is owned by a user or a group.
This property describes the CreatorType of the place, whether the
place is owned by a user or a group. If User, then the
DataModel.CreatorId property will describe the
UserId of the account that owns the game. If
Group, then it will describe the group ID.
GearGenreSetting Supported Property Deprecated Legacy gear-permission metadata. Nova stores and returns the value, but does not use it.
Legacy gear-permission metadata. Nova stores and returns the value, but does not use it.
Historically this described the gear permissions of a place as set on the Roblox website. Nova stores the value and returns it, but does not use it to filter gear. It does not throw on read in Nova.
Genre Supported Property Deprecated Legacy place metadata. Nova stores and returns the value, but does not use it to drive settings.
Legacy place metadata. Nova stores and returns the value, but does not use it to drive settings.
Historically this described the place genre selected on the Roblox website. Nova stores the value and returns it from the property, but does not use it to configure the place. Modern Roblox may treat reads as broken; that is not true of Nova's 2016 implementation.
IsPersonalServer Supported Property
No description available.
RobloxScriptSecurityJobId Supported Property A unique identifier for the running game server instance.
This property is a unique identifier for the running game server instance. It is a universally unique identifier (UUID), meaning that no two servers, past or present, will ever have the same ID.
Defaults to an empty string in Studio.
See Also¶
- TeleportService.GetPlayerPlaceInstanceAsync() which can be used to retrieve the DataModel.JobId of a user's current server.
- TeleportService.TeleportToPlaceInstance() which can be used to teleport a Player to a specific server.
- DataModel.PrivateServerId describes the ID of the private server the game server instance belongs to.
- HttpService.GenerateGUID(), a function that can be used to generate your own UUIDs.
lighting Supported Property Deprecated Refers to the game's Lighting service.
LocalSaveEnabled Supported Property
No description available.
RobloxScriptSecurityPlaceId Supported Property Describes the ID of the place running on the server.
This property describes the ID of the place running on the server.
If the place has not been published to Roblox, this ID will correspond with the template being used.
See Also¶
- DataModel.GameId, which describes the ID of the experience that the current place belongs to
- DataModel.JobId, which is a unique identifier for the server game instance running
- TeleportService, which is a service that can be used to transport Players between places
PlaceVersion Supported Property Describes the version of the place the server is running on.
This property describes the version of the place the server is running on.
This version number corresponds with the version number shown under the Version History section of the place's settings. It is not the current version of the Roblox client. This property is 0 for all unpublished experiences.
When a server instance is created for a place, it uses the place's current version. If the place is later updated while this server is running, the server will remain at its current version.
This property can be used to display a ScreenGui showing the current version of the game to Players to assist with debugging.
VIPServerId Supported Property Deprecated A string that could identify the current server as a private server.
A string that could identify the current server as a private server.
This property was string that could identify the current server as a private server.
VIPServerOwnerId Supported Property Deprecated The UserId of the account who owns the private server.
This property indicates the UserId of the account who owns the private server.
Workspace Supported Property A reference to the Workspace service.
workspace Supported Property Deprecated Deprecated. Use Workspace
Deprecated. Use Workspace
Methods¶
AddStat Supported Function
No description available.
LocalUserSecurityClearContent Supported Function
No description available.
LocalUserSecurityClearMessage Supported Function
FinishShutdown Supported Function
No description available.
RobloxScriptSecurityget Supported Function Deprecated Use GetObjects() instead
Use GetObjects() instead
LocalUserSecurityGetJobIntervalPeakFraction Supported Function
No description available.
PluginSecurityGetJobsExtendedStats Supported Function
No description available.
PluginSecurityGetJobsInfo Supported Function Returns a table containing basic information about the jobs performed by the task scheduler.
Returns a table containing basic information about the jobs performed by the task scheduler.
In computing, a task scheduler is a system responsible for executing key tasks at the appropriate intervals.
You can also find live task scheduler statistics in the Task Scheduler window in Roblox Studio.
The first entry in the table returned is a reference dictionary containing the statistics (or headings) available. It is in the following format:
{
["name"] = "name",
["averageDutyCycle"] = "averageDutyCycle",
["averageStepsPerSecond"] = "averageStepsPerSecond",
["averageStepTime"] = "averageStepTime",
["averageError"] = "averageError",
["isRunning"] = "isRunning",
}
The subsequent entries in the table returned are dictionaries containing the above statistics for jobs performed by the task scheduler. For example:
{
["name"] = "Heartbeat",
["averageDutyCycle"] = 0,
["averageStepsPerSecond"] = 0,
["averageStepTime"] = 0,
["averageError"] = 0,
["isRunning"] = false,
}
See also:
PluginSecurityGetJobTimePeakFraction Supported Function
No description available.
PluginSecurityGetMessage Supported Function Deprecated Returns the current loading message. Nova still uses it for loading progress.
Returns the current loading message. Nova still uses it for loading progress.
Modern Roblox documents this as always returning an empty string. Nova's
2016 implementation still uses it: when the internal loading message is
the progress placeholder, it returns a Loading... progress line with
instance, brick, and connector counts.
GetObjects Supported Function Deprecated Returns an array of Instances associated with the given content URL.
This method returns an array of Instances associated with the given content URL. It can be used to insert content from the Roblox library. It's not possible to insert Sounds using this method as they do not have an Instance associated with them and have only a content URL.
Unlike InsertService.LoadAsset(), DataModel:GetObjects() does
not require an asset to be "trusted," meaning that an asset doesn't need
to be owned by the logged in user, or created by Roblox, to be inserted.
However, if the asset is not owned by the logged in user it must be freely
available.
Due to this function's security context it can only be used by plugins or the command bar. For an alternative that can be used in Scripts and LocalScripts, see InsertService.LoadAsset().
PluginSecurityGetRemoteBuildMode Supported Function Deprecated This method is no longer useful and will always return false.
This method is no longer useful and will always return false. Use RunService.IsServer() to see if your code is running on the server.
HttpGet Supported Function
No description available.
RobloxScriptSecurityHttpGetAsync Supported Function
No description available.
Roblox reference signature
RobloxScriptSecurityHttpPost Supported Function
HttpPostAsync Supported Function
No description available.
Roblox reference signature
RobloxScriptSecurityIsGearTypeAllowed Supported Function Deprecated Returns whether gear of the given GearType is permitted to be added to Class.Player|Players' StarterGears.
Currently this function only returns the correct value on the client
This function returns whether gear of the given GearType is
permitted to be added to Class.Player|Players'
StarterGears. For example:
Whether gear of a specific GearType is permitted in the game is determined in a place's settings page under 'Permissions'. Note, all of a gear's associated GearTypes must be enabled for it to be permitted in a place.
IsLoaded Supported Function Returns true if the client has finished loading the game for the first time.
Returns true if the client has finished loading the game for the first time.
When all initial Instances in the game have finished replicating to the client, this function returns true.
Unless they are parented to ReplicatedFirst, LocalScripts do not run until the game has loaded. The following snippet, run from a LocalScript in ReplicatedFirst yields until the game has loaded:
See also:
- Replication order for a more detailed summary of the loading process.
- DataModel.Loaded, an event that fires when the game has loaded
- Instance.WaitForChild(), a function which can be used to wait for an individual Instance to replicate without having to wait for the whole game to finish loading.
Load Supported Function
No description available.
LocalUserSecurityLoadGame Supported Function
No description available.
LocalUserSecurityLoadPlugins Supported Function
LoadWorld Supported Function
No description available.
LocalUserSecurityRemoveStat Supported Function
No description available.
LocalUserSecurityReportInGoogleAnalytics Supported Function
ReportMeasurement Supported Function
No description available.
RobloxScriptSecuritySave Supported Function
SavePlace Supported Function Deprecated Saves the current place.
Saves the current place.
This function was used by an ancient data persistence method to save the current place.
Note:
- In order for this method to work the save place API has to be enabled for the current place.
SaveStats Supported Function
SaveToRoblox Supported Function
No description available.
RobloxScriptSecurityServerSave Supported Function
SetCreatorID Supported Function Deprecated Use SetCreatorId() instead
Use SetCreatorId() instead
PluginSecuritySetCreatorId Supported Function
No description available.
PluginSecuritySetGameInstanceId Supported Function
No description available.
PluginSecuritySetGearSettings Supported Function
No description available.
PluginSecuritySetGenre Supported Function
No description available.
PluginSecuritySetJobsExtendedStatsWindow Supported Function
No description available.
LocalUserSecuritySetMessage Supported Function
No description available.
LocalUserSecuritySetMessageBrickCount Supported Function
No description available.
LocalUserSecuritySetPlaceID Supported Function Deprecated Use SetPlaceId() instead
Use SetPlaceId() instead
PluginSecuritySetPlaceId Supported Function Sets the DataModel.PlaceId of the current game instance.
Sets the DataModel.PlaceId of the current game instance.
This function sets the DataModel.PlaceId of the game instance to
the given placeId.
PluginSecuritySetPlaceVersion Supported Function
No description available.
PluginSecuritySetRemoteBuildMode Supported Function
No description available.
LocalUserSecuritySetScreenshotInfo Supported Function
No description available.
LocalUserSecuritySetServerSaveUrl Supported Function
No description available.
LocalUserSecuritySetUniverseId Supported Function Sets the DataModel.GameId of the current game instance to the given universeId.
This function sets the DataModel.GameId of the current game
instance to the given universeId. This is useful when testing local
.rbxl files that have not been published to Roblox.
To access the DataStoreService in an unpublished place, both DataModel.SetUniverseId() and DataModel.SetPlaceId() must be set.
PluginSecuritySetVideoInfo Supported Function
No description available.
LocalUserSecuritySetVIPServerId Supported Function
No description available.
LocalUserSecuritySetVIPServerOwnerId Supported Function
No description available.
LocalUserSecurityShutdown Supported Function
No description available.
LocalUserSecurityToggleTools Supported Function
Events¶
AllowedGearTypeChanged Supported Event Deprecated Fires when SetGearSettings is called with a different value for allowedGenres.
This event fires when SetGearSettings is called with a different value for
allowedGenres.
GraphicsQualityChangeRequest Supported Event Fires when the user prompts and increase or decrease in graphics quality using the hotkeys.
Fires when the user prompts and increase or decrease in graphics quality using the hotkeys.
Fires when the user prompts an increase or decrease in graphics quality using the hotkeys.
This event fires under the following conditions:
- If the user presses F10, this event fires with a
betterQualityargument oftrue. - If the user presses ShiftF10, this event fires
with a
betterQualityargument offalse.
This event does not provide the current graphics quality level or cover all updates to the graphics quality. For example, changes made in the core GUI escape menu are not registered.
You can retrieve a user's SavedQualitySetting using UserGameSettings with the following snippet:
If the user's graphics settings are set to automatic then the SavedQualitySetting will be Automatic. There is currently no way for developers to reliably get the current graphics quality level of a user's machine.
ItemChanged Supported Event Deprecated Fires when a property of any object in the DataModel is changed.
This event fires when a property of any object in the DataModel is changed.
Loaded Supported Event Fires on the client when the game finishes loading for the first time.
Fires on the client when the game finishes loading for the first time.
This event fires on the client when all initial Instances in the game have finished replicating to the client.
Unless they are parented to ReplicatedFirst, LocalScripts do not run until the game has loaded. The following snippet, run from a LocalScript in ReplicatedFirst yields until the game has loaded:
See also:
- Replication order for a more detailed summary of the loading process.
- DataModel.Loaded, an event that fires when the game has loaded
- Instance.WaitForChild(), a function which can be used to wait for an individual Instance to replicate without having to wait for the whole game to finish loading.
Callbacks¶
OnClose Supported Callback Deprecated Invoked before the game is shut down. When this callback returns, or the timeout period is hit, the game finishes shutting down.
Invoked before the game is shut down. When this callback returns, or the timeout period is hit, the game finishes shutting down.
RequestShutdown Supported Callback
No description available.
RobloxScriptSecurityInherited members¶
Inherited from ServiceProvider: 8 properties, 40 methods, 11 events. They are documented on the base class page.
39 modern Roblox member(s) are not implemented yet — expand to inspect
Members declared by Roblox's DataModel class (or by a missing base class) that Nova does not expose. Use this list to scope a migration; the compatibility guide has the recommended workaround.
Properties¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
Environment |
Environment: string |
Not yet | — | ReadOnly, NotReplicated, RobloxScriptSecurity |
GameId |
GameId: int64 |
Not yet | Describes the ID of the experience that the place running on the server belongs to. | ReadOnly, NotReplicated |
MatchmakingType |
MatchmakingType: MatchmakingType |
Not yet | Represents how players in the server are handled by matchmaking. | ReadOnly, NotReplicated |
PrivateServerId |
PrivateServerId: string |
Not yet | Describes the private server ID of the server, if the server is a VIP server or a reserved server. VIP servers and reserved servers are the two types of private servers. | ReadOnly, NotReplicated |
PrivateServerOwnerId |
PrivateServerOwnerId: int64 |
Not yet | Describes the UserId of the Player that owns the private server if the server is VIP. | ReadOnly, NotReplicated |
RunService |
RunService: RunService |
Not yet | A reference to the RunService service. | ReadOnly, NotReplicated |
Methods¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
BindToClose |
DataModel:BindToClose(function: Function): null |
Not yet | Binds a function to be called before the server shuts down. | — |
DefineFastFlag |
DataModel:DefineFastFlag(name: string, defaultValue: bool): bool |
Not yet | — | RobloxScriptSecurity |
DefineFastInt |
DataModel:DefineFastInt(name: string, defaultValue: int): int |
Not yet | — | RobloxScriptSecurity |
DefineFastString |
DataModel:DefineFastString(name: string, defaultValue: string): string |
Not yet | — | RobloxScriptSecurity |
GetEngineFeature |
DataModel:GetEngineFeature(name: string): bool |
Not yet | — | LocalUserSecurity |
GetFastFlag |
DataModel:GetFastFlag(name: string): bool |
Not yet | — | LocalUserSecurity |
GetFastInt |
DataModel:GetFastInt(name: string): int |
Not yet | — | LocalUserSecurity |
GetFastString |
DataModel:GetFastString(name: string): string |
Not yet | — | LocalUserSecurity |
getGameTime |
DataModel:getGameTime(): double |
Not yet | — | RobloxScriptSecurity |
GetObjectsAllOrNone |
DataModel:GetObjectsAllOrNone(url: ContentId): Instances |
Not yet | — | RobloxScriptSecurity |
GetObjectsAsync |
DataModel:GetObjectsAsync(url: ContentId): Instances |
Not yet | — | Yields, RobloxScriptSecurity |
GetObjectsList |
DataModel:GetObjectsList(urls: Array): Array |
Not yet | — | RobloxScriptSecurity |
GetPioneerRootPlaceId |
DataModel:GetPioneerRootPlaceId(): int64 |
Not yet | — | RobloxScriptSecurity |
GetPioneerSource |
DataModel:GetPioneerSource(): PioneerSource |
Not yet | — | RobloxScriptSecurity |
GetPlaySessionId |
DataModel:GetPlaySessionId(): string |
Not yet | — | RobloxScriptSecurity |
InsertObjectsAndJoinIfLegacyAsync |
DataModel:InsertObjectsAndJoinIfLegacyAsync(url: ContentId): Instances |
Not yet | — | Yields, RobloxScriptSecurity |
IsContentLoaded |
DataModel:IsContentLoaded(): bool |
Not yet | — | RobloxScriptSecurity |
IsPioneerApp |
DataModel:IsPioneerApp(): bool |
Not yet | — | RobloxScriptSecurity |
IsUniverseMetadataLoaded |
DataModel:IsUniverseMetadataLoaded(): bool |
Not yet | — | RobloxScriptSecurity |
OpenLogsFolder |
DataModel:OpenLogsFolder(): null |
Not yet | — | RobloxScriptSecurity |
OpenScreenshotsFolder |
DataModel:OpenScreenshotsFolder(): null |
Not yet | — | RobloxScriptSecurity |
OpenVideosFolder |
DataModel:OpenVideosFolder(): null |
Not yet | — | RobloxScriptSecurity |
SetFastFlagForTesting |
DataModel:SetFastFlagForTesting(name: string, newValue: bool): bool |
Not yet | — | RobloxScriptSecurity |
SetFastIntForTesting |
DataModel:SetFastIntForTesting(name: string, newValue: int): int |
Not yet | — | RobloxScriptSecurity |
SetFastStringForTesting |
DataModel:SetFastStringForTesting(name: string, newValue: string): string |
Not yet | — | RobloxScriptSecurity |
SetFlagVersion |
DataModel:SetFlagVersion(name: string, version: int): null |
Not yet | — | RobloxScriptSecurity |
SetIsLoaded |
DataModel:SetIsLoaded(value: bool, placeSizeInBytes: int?): null |
Not yet | — | RobloxScriptSecurity |
Events¶
| Member | Signature | Status | Notes | Flags |
|---|---|---|---|---|
ScreenshotReady |
ScreenshotReady(path: string) |
Not yet | — | RobloxScriptSecurity |
ScreenshotSavedToAlbum |
ScreenshotSavedToAlbum(filename: string, success: bool, message: string) |
Not yet | — | RobloxScriptSecurity |
ServerLifecycleChanged |
ServerLifecycleChanged(serverLifecycleChangedEvent: Dictionary) |
Not yet | — | — |
ServerLowMemoryWarning |
ServerLowMemoryWarning() |
Not yet | — | — |
ServerRestartScheduled |
ServerRestartScheduled(restartTime: DateTime, source: CloseReason, attributes: Dictionary) |
Not yet | Fires on the server when the server has been scheduled to restart. Provides the scheduled restart time, source, and custom attributes. | — |
UniverseMetadataLoaded |
UniverseMetadataLoaded() |
Not yet | — | RobloxScriptSecurity |
Roblox reference: DataModel
Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.