# DataModel

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [ServiceProvider](https://rapi.sleaze.dev/classes/ServiceProvider.md), [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/DataModel/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/DataModel

The root of Roblox's parent-child hierarchy. Its direct children are services, such as [`Workspace`](https://rapi.sleaze.dev/classes/Workspace.md) and [`Lighting`](https://rapi.sleaze.dev/classes/Lighting.md), that act as the fundamental components of a Roblox game.

## Properties

### IsSFFlagsLoaded

```luau
DataModel.IsSFFlagsLoaded: boolean
```

- Tags: Hidden, Read only, Roblox script security

### MatchmakingType

```luau
DataModel.MatchmakingType: Enum.MatchmakingType
```

- Tags: Read only, Save only

Represents how players in the server are handled by matchmaking.

### PrivateServerId

```luau
DataModel.PrivateServerId: string
```

- Tags: Read only, Save only

Describes the private server ID of the server, if the server is a private server or a `reserved server`.

### PrivateServerOwnerId

```luau
DataModel.PrivateServerOwnerId: number
```

- Tags: Read only, Save only

Describes the `UserId` of the [`Player`](https://rapi.sleaze.dev/classes/Player.md) that owns the private server if the server is private.

### RunService

```luau
DataModel.RunService: RunService
```

- Tags: Read only

A reference to the [`RunService`](https://rapi.sleaze.dev/classes/RunService.md) service.

### Workspace

```luau
DataModel.Workspace: Workspace
```

- Tags: Read only

A reference to the [`Workspace`](https://rapi.sleaze.dev/classes/Workspace.md) service.

### VIPServerId

```luau
DataModel.VIPServerId: string
```

- Tags: Deprecated, Hidden, Read only, Save only
- Use instead: [`DataModel.PrivateServerId`](https://rapi.sleaze.dev/classes/DataModel.md)

**Deprecated:** This property has been deprecated. Use [`DataModel.PrivateServerId`](https://rapi.sleaze.dev/classes/DataModel.md) instead.

A string that could identify the current server as a private server.

### VIPServerOwnerId

```luau
DataModel.VIPServerOwnerId: number
```

- Tags: Deprecated, Hidden, Read only, Save only
- Use instead: [`DataModel.PrivateServerOwnerId`](https://rapi.sleaze.dev/classes/DataModel.md)

**Deprecated:** This property has been deprecated. Use [`DataModel.PrivateServerOwnerId`](https://rapi.sleaze.dev/classes/DataModel.md) instead.

The `UserId` of the account who owns the private server.

### lighting

```luau
DataModel.lighting: Instance
```

- Tags: Deprecated, Read only

**Deprecated:** This item has been superseded by `game:GetService("Lighting")`, which should be used instead.

Refers to the game's [`Lighting`](https://rapi.sleaze.dev/classes/Lighting.md) service.

### workspace

```luau
DataModel.workspace: Workspace
```

- Tags: Deprecated, Read only
- Use instead: [`DataModel.Workspace`](https://rapi.sleaze.dev/classes/DataModel.md)

**Deprecated:** This deprecated property is a variant of [`DataModel.Workspace`](https://rapi.sleaze.dev/classes/DataModel.md) which should be used instead.

### JobId

```luau
DataModel.JobId: string
```

- Tags: Read only

A unique identifier for the running game server instance.

### CreatorId

```luau
DataModel.CreatorId: number
```

- Tags: Read only

Describes the ID of the user or group that owns the place.

### CreatorType

```luau
DataModel.CreatorType: Enum.CreatorType
```

- Tags: Read only

Describes the [`CreatorType`](https://rapi.sleaze.dev/classes/DataModel.md) of the place, whether the place is owned by a user or a group.

### Environment

```luau
DataModel.Environment: string
```

- Tags: Read only, Roblox script security

### ForceR15

```luau
DataModel.ForceR15: boolean
```

- Tags: Hidden, Not scriptable, Roblox engine security

### GameId

```luau
DataModel.GameId: number
```

- Tags: Read only

Describes the ID of the experience that the place running on the server belongs to.

### Genre

```luau
DataModel.Genre: Enum.Genre
```

- Tags: Read only

Not functional. Historically described the [`Genre`](https://rapi.sleaze.dev/classes/DataModel.md) of the place as set on the Roblox website.

### PlaceId

```luau
DataModel.PlaceId: number
```

- Tags: Read only

Describes the ID of the place running on the server.

### PlaceVersion

```luau
DataModel.PlaceVersion: number
```

- Tags: Read only

Describes the version of the place the server is running on.

### GameAvatarType

```luau
DataModel.GameAvatarType: Enum.GameAvatarType
```

- Tags: Deprecated, Hidden, Not scriptable, Roblox engine security

### GearGenreSetting

```luau
DataModel.GearGenreSetting: Enum.GearGenreSetting
```

- Tags: Deprecated, Read only

**Deprecated:** This property is deprecated and is no longer functional. It should not be used.

Not functional. Historically described the gear permissions of the place as set on the Roblox website.

### IsPioneerBuild

```luau
DataModel.IsPioneerBuild: boolean
```

- Tags: Deprecated, Hidden, Read only, Roblox script security

### PioneerSource

```luau
DataModel.PioneerSource: Enum.PioneerSource
```

- Tags: Deprecated, Hidden, Read only, Roblox script security

### R15CollisionType

```luau
DataModel.R15CollisionType: Enum.R15CollisionType
```

- Tags: Deprecated, Hidden, Not scriptable, Roblox engine security

## Methods

### BindToClose

```luau
DataModel:BindToClose(function: (...any) -> ...any)
```

Binds a function to be called before the server shuts down.

Parameters:

- `function`: A function called before the experience server shuts down. If the bound function accepts a parameter, it passes `CloseReason` specifying the reason for the server shutdown.

### DefineFastFlag

```luau
DataModel:DefineFastFlag(name: string, defaultValue: boolean): boolean
```

- Tags: Roblox script security

### DefineFastInt

```luau
DataModel:DefineFastInt(name: string, defaultValue: number): number
```

- Tags: Roblox script security

### DefineFastString

```luau
DataModel:DefineFastString(name: string, defaultValue: string): string
```

- Tags: Roblox script security

### GetEngineFeature

```luau
DataModel:GetEngineFeature(name: string): boolean
```

- Tags: Local user security

### GetFastFlag

```luau
DataModel:GetFastFlag(name: string): boolean
```

- Tags: Local user security

### GetFastInt

```luau
DataModel:GetFastInt(name: string): number
```

- Tags: Local user security

### GetFastString

```luau
DataModel:GetFastString(name: string): string
```

- Tags: Local user security

### GetJobsInfo

```luau
DataModel:GetJobsInfo(): { any }
```

- Tags: Plugin security

Returns a table containing basic information about the jobs performed by the task scheduler.

Returns: A table containing information about the jobs performed by the task scheduler, see above for the format.

### GetObjects

```luau
DataModel:GetObjects(url: string): { Instance }
```

- Tags: Plugin security

Returns an array of [`Instances`](https://rapi.sleaze.dev/index/types/Instances.md) associated with the given content URL.

Parameters:

- `url`: The given content URL.

Returns: An array of [`Instances`](https://rapi.sleaze.dev/index/types/Instances.md) associated with the content URL.

### GetObjectsAllOrNone

```luau
DataModel:GetObjectsAllOrNone(url: string): { Instance }
```

- Tags: Roblox script security

### GetObjectsAsync

```luau
DataModel:GetObjectsAsync(url: string): { Instance }
```

- Tags: Yields, Roblox script security

### GetObjectsList

```luau
DataModel:GetObjectsList(urls: { any }): { any }
```

- Tags: Roblox script security

### GetPioneerRootPlaceId

```luau
DataModel:GetPioneerRootPlaceId(): number
```

- Tags: Roblox script security

### GetPioneerSource

```luau
DataModel:GetPioneerSource(): Enum.PioneerSource
```

- Tags: Roblox script security

### GetPlaySessionId

```luau
DataModel:GetPlaySessionId(): string
```

- Tags: Roblox script security

### HttpGetAsync

```luau
DataModel:HttpGetAsync(url: string, httpRequestType: Enum.HttpRequestType? = Enum.HttpRequestType.Default): string
```

- Tags: Yields, Roblox script security

### HttpPostAsync

```luau
DataModel:HttpPostAsync(url: string, data: string, contentType: string? = "*/*", httpRequestType: Enum.HttpRequestType? = Enum.HttpRequestType.Default): string
```

- Tags: Yields, Roblox script security

### InsertObjectsAndJoinIfLegacyAsync

```luau
DataModel:InsertObjectsAndJoinIfLegacyAsync(url: string): { Instance }
```

- Tags: Yields, Roblox script security

### IsContentLoaded

```luau
DataModel:IsContentLoaded(): boolean
```

- Tags: Roblox script security

### IsLoaded

```luau
DataModel:IsLoaded(): boolean
```

Returns true if the client has finished loading the game for the first time.

Returns: Whether the client has finished loading the game for the first time.

### IsPioneerApp

```luau
DataModel:IsPioneerApp(): boolean
```

- Tags: Roblox script security

### IsUniverseMetadataLoaded

```luau
DataModel:IsUniverseMetadataLoaded(): boolean
```

- Tags: Roblox script security

### Load

```luau
DataModel:Load(url: string)
```

- Tags: Local user security

### OpenLogsFolder

```luau
DataModel:OpenLogsFolder()
```

- Tags: Roblox script security

### OpenScreenshotsFolder

```luau
DataModel:OpenScreenshotsFolder()
```

- Tags: Roblox script security

### OpenVideosFolder

```luau
DataModel:OpenVideosFolder()
```

- Tags: Roblox script security

### SetFastFlagForTesting

```luau
DataModel:SetFastFlagForTesting(name: string, newValue: boolean): boolean
```

- Tags: Roblox script security

### SetFastIntForTesting

```luau
DataModel:SetFastIntForTesting(name: string, newValue: number): number
```

- Tags: Roblox script security

### SetFastStringForTesting

```luau
DataModel:SetFastStringForTesting(name: string, newValue: string): string
```

- Tags: Roblox script security

### SetFlagVersion

```luau
DataModel:SetFlagVersion(name: string, version: number)
```

- Tags: Roblox script security

### SetIsLoaded

```luau
DataModel:SetIsLoaded(value: boolean, placeSizeInBytes: number?)
```

- Tags: Roblox script security

### SetPlaceId

```luau
DataModel:SetPlaceId(placeId: number)
```

- Tags: Plugin security

Sets the [`DataModel.PlaceId`](https://rapi.sleaze.dev/classes/DataModel.md) of the current game instance.

Parameters:

- `placeId`: The ID to set the [`DataModel.PlaceId`](https://rapi.sleaze.dev/classes/DataModel.md) to.

### SetUniverseId

```luau
DataModel:SetUniverseId(universeId: number)
```

- Tags: Plugin security

Sets the [`DataModel.GameId`](https://rapi.sleaze.dev/classes/DataModel.md) of the current game instance to the given `universeId`.

Parameters:

- `universeId`: The ID to set the [`DataModel.GameId`](https://rapi.sleaze.dev/classes/DataModel.md) to.

### Shutdown

```luau
DataModel:Shutdown()
```

- Tags: Local user security

### getGameTime

```luau
DataModel:getGameTime(): number
```

- Tags: Roblox script security

### GetMessage

```luau
DataModel:GetMessage(): string
```

- Tags: Deprecated

**Deprecated:** This item is deprecated since the system was phased out a very long time ago, and recently the APIs for setting this message were removed.

***[OBSOLETE]:*** This function will always return a blank string.

### GetRemoteBuildMode

```luau
DataModel:GetRemoteBuildMode(): boolean
```

- Tags: Deprecated

**Deprecated:** This item is deprecated. Use [`RunService:IsServer()`](https://rapi.sleaze.dev/classes/RunService.md) to see if your code is running on the server.

This method is no longer useful and will always return false.

### IsGearTypeAllowed

```luau
DataModel:IsGearTypeAllowed(gearType: Enum.GearType): boolean
```

- Tags: Deprecated

**Deprecated:** This property is deprecated and is no longer functional. It should not be used.

Returns whether gear of the given `GearType` is permitted to be added to `Players'` `StarterGears`.

Parameters:

- `gearType`: The given `GearType`.

Returns: Whether gear of the given `GearType` is permitted in the game.

### SavePlace

```luau
DataModel:SavePlace(saveFilter: Enum.SaveFilter? = Enum.SaveFilter.SaveAll): boolean
```

- Tags: Deprecated, Yields

**Deprecated:** This item is deprecated. Do not use it for new work.

Saves the current place.

## Events

### GraphicsQualityChangeRequest

```luau
DataModel.GraphicsQualityChangeRequest: RBXScriptSignal<(betterQuality: boolean)>
```

Fires when the user prompts and increase or decrease in graphics quality using the hotkeys.

### Loaded

```luau
DataModel.Loaded: RBXScriptSignal<()>
```

Fires on the client when the game finishes loading for the first time.

### ScreenshotReady

```luau
DataModel.ScreenshotReady: RBXScriptSignal<(path: string)>
```

- Tags: Roblox script security

### ScreenshotSavedToAlbum

```luau
DataModel.ScreenshotSavedToAlbum: RBXScriptSignal<(filename: string, success: boolean, message: string)>
```

- Tags: Roblox script security

### ServerLifecycleChanged

```luau
DataModel.ServerLifecycleChanged: RBXScriptSignal<(serverLifecycleChangedEvent: { [string]: any })>
```

- Tags: Capabilities: ServerCommunication

### ServerLowMemoryWarning

```luau
DataModel.ServerLowMemoryWarning: RBXScriptSignal<()>
```

### ServerRestartScheduled

```luau
DataModel.ServerRestartScheduled: RBXScriptSignal<(restartTime: DateTime, source: Enum.CloseReason, attributes: { [string]: any })>
```

- Tags: Capabilities: ServerCommunication

Fires on the server when the server has been scheduled to restart. Provides the scheduled restart time, source, and custom attributes.

### UniverseMetadataLoaded

```luau
DataModel.UniverseMetadataLoaded: RBXScriptSignal<()>
```

- Tags: Roblox script security

### AllowedGearTypeChanged

```luau
DataModel.AllowedGearTypeChanged: RBXScriptSignal<()>
```

- Tags: Deprecated

**Deprecated:** This item is deprecated . Do not use it for new work.

Fires when SetGearSettings is called with a different value for `allowedGenres`.

### ItemChanged

```luau
DataModel.ItemChanged: RBXScriptSignal<(object: Instance, descriptor: string)>
```

- Tags: Deprecated

**Deprecated:** This function has been superseded by [`Object.Changed`](https://rapi.sleaze.dev/classes/Object.md), which should be used in new work instead.

Fires when a property of any object in the [`DataModel`](https://rapi.sleaze.dev/classes/DataModel.md) is changed.

## Callbacks

### OnClose

```luau
DataModel.OnClose: () -> ...any
```

- Tags: Deprecated
- Use instead: [`DataModel.BindToClose`](https://rapi.sleaze.dev/classes/DataModel.md)

**Deprecated:** This function is deprecated. It is recommended to use [`DataModel:BindToClose()`](https://rapi.sleaze.dev/classes/DataModel.md) instead.

Invoked before the game is shut down. When this callback returns, or the timeout period is hit, the game finishes shutting down.

## Inherited members

- From [ServiceProvider](https://rapi.sleaze.dev/classes/ServiceProvider.md): `FindService`, `GetService`, `getService`, `service`, `Close`, `CloseLate`, `ServiceAdded`, `ServiceRemoving`
- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
