Open Asterune
DataModel

DataModel

Contains the place hierarchy and provides access to services.

Not creatable
Created by the engine or used as a base class.
Inherits
Instance
Replication
Standard

Behavior

DataModel contains the place hierarchy and provides access to services.

Summary

Members16
Properties12
Methods4

Properties

CreatorId

DataModel.CreatorId: number

The identifier of the place's creator.

CreatorType

DataModel.CreatorType: EnumItem

Whether the creator identifier refers to a user or a group.

GameId

DataModel.GameId: number

The game identifier associated with the current place.

JobId

DataModel.JobId: string

The identifier of the running server session.

Lighting

DataModel.Lighting: Lighting

The Lighting service controlling scene illumination.

OnClose

DataModel.OnClose: function?

Callback invoked when the place closes. Use BindToClose to register independent callbacks.

PlaceId

DataModel.PlaceId: number

The identifier of the current place.

PlaceVersion

DataModel.PlaceVersion: number

The saved version number of the current place.

Players

DataModel.Players: Players

The Players service containing connected players.

PrivateServerId

DataModel.PrivateServerId: string

The identifier of the private server session.

PrivateServerOwnerId

DataModel.PrivateServerOwnerId: number

The user identifier of the private server's owner.

Workspace

DataModel.Workspace: Workspace

The Workspace service containing the simulated world.

Methods

BindToClose

DataModel:BindToClose(callback: () -> ()): ()

Registers a callback to run when the place closes.

FindService

DataModel:FindService(className: string): Instance?

Returns an existing service with the specified class name, or nil if it is absent.

GetExecutionGroup

DataModel:GetExecutionGroup(): ExecutionGroup?

Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.

GetService

DataModel:GetService(className: string): Instance

Returns the service with the specified class name. Unknown service names cause an error.

Inherited members

Inherited47

Instance