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
The identifier of the place's creator.
Whether the creator identifier refers to a user or a group.
The game identifier associated with the current place.
The identifier of the running server session.
The Lighting service controlling scene illumination.
Callback invoked when the place closes.
The identifier of the current place.
The saved version number of the current place.
The Players service containing connected players.
The identifier of the private server session.
The user identifier of the private server's owner.
The Workspace service containing the simulated world.
Registers a callback to run when the place closes.
Returns an existing service with the specified class name, or nil if it is absent.
Returns this instance if it is an ExecutionGroup.
Returns the service with the specified class name.
Properties
CreatorId
DataModel.CreatorId: numberThe identifier of the place's creator.
CreatorType
DataModel.CreatorType: EnumItemWhether the creator identifier refers to a user or a group.
GameId
DataModel.GameId: numberThe game identifier associated with the current place.
JobId
DataModel.JobId: stringThe identifier of the running server session.
Lighting
DataModel.Lighting: LightingThe Lighting service controlling scene illumination.
OnClose
DataModel.OnClose: function?Callback invoked when the place closes. Use BindToClose to register independent callbacks.
PlaceId
DataModel.PlaceId: numberThe identifier of the current place.
PlaceVersion
DataModel.PlaceVersion: numberThe saved version number of the current place.
Players
DataModel.Players: PlayersThe Players service containing connected players.
PrivateServerId
DataModel.PrivateServerId: stringThe identifier of the private server session.
PrivateServerOwnerId
DataModel.PrivateServerOwnerId: numberThe user identifier of the private server's owner.
Workspace
DataModel.Workspace: WorkspaceThe 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): InstanceReturns the service with the specified class name. Unknown service names cause an error.
Inherited members
- Properties
- ArchivableClassNameNameParent
- Methods
- AddComponent()AddTag()ClearAllChildren()ClearTags()Clone()Destroy()FindFirstAncestor()FindFirstAncestorOfClass()FindFirstAncestorWhichIsA()FindFirstChild()FindFirstChildOfClass()FindFirstChildWhichIsA()FindFirstDescendant()GetAttribute()GetAttributeChangedSignal()GetAttributes()GetChildren()GetComponent()GetComponentChangedSignal()GetComponents()GetDebugId()GetDescendants()GetFullName()GetPropertyChangedSignal()GetReferencing()GetTags()HasComponent()HasTag()IsA()IsAncestorOf()IsDescendantOf()RemoveComponent()RemoveTag()SetAttribute()WaitForChild()
- Events
- AncestryChangedAttributeChangedChangedChildAddedChildRemovedDescendantAddedDescendantRemovingDestroying