API:Class/DataModel

< API:Class(Redirected from DataModel)

DataModel.pngDataModel : Object Icon.pngServiceProvider : Object Icon.pngInstance

The DataModel (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 the services such as the Workspace and Lighting in a game that act as containers for everything else, and also some services that aren't used for containing things and are hidden from the browser for this reason. Every object that currently "exists" in the game hierarchy will have the DataModel as its ultimate ancestor.
The DataModel's own members are for looking at or altering properties of the currently running game.

Properties

PropertiesmemberhiddenProperties [toggle]

intCreatorId [readonly]

The place creator's UserId.

|RMD member="API:Class/DataModel/CreatorId"|The place creator's UserId.|/RMD|
CreatorTypeCreatorType [readonly]

The CreatorType of the current place.

|RMD member="API:Class/DataModel/CreatorType"|The CreatorType of the current place.|/RMD|
GearGenreSettingGearGenreSetting [readonly]

The type of gear that are allowed to enter the DataModel through the LocalPlayer's StarterPack.

|RMD member="API:Class/DataModel/GearGenreSetting"|The type of gear that are allowed to enter the DataModel through the LocalPlayer's StarterPack.|/RMD|
GenreGenre [readonly]

The game's genre.

|RMD member="API:Class/DataModel/Genre"|The game's genre.|/RMD|
stringJobId [readonly]

A unique identifier for the current game server. Defaults to the empty string in offline mode.

|RMD member="API:Class/DataModel/JobId"|A unique identifier for the current game server. Defaults to the empty string in offline mode.|/RMD|
intPlaceId [readonly]

The Asset Id of the current place.

|RMD member="API:Class/DataModel/PlaceId"|The Asset Id of the current place.|/RMD|
intPlaceVersion [readonly]

The version of the game that the server is running on.

|RMD member="API:Class/DataModel/PlaceVersion"|The version of the game that the server is running on.|/RMD|
stringVIPServerId [readonly]

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

|RMD member="API:Class/DataModel/VIPServerId"|A string that could identify the current server as a VIP server.|/RMD|
intVIPServerOwnerId [readonly]

The UserId of the account who owns the VIP server.

|RMD member="API:Class/DataModel/VIPServerOwnerId"|The UserId of the account who owns the VIP server.|/RMD|
WorkspaceWorkspace [readonly]

A reference to the Workspace.

|RMD member="API:Class/DataModel/Workspace"|A reference to the Workspace.|/RMD|
Lightinglighting [deprecated] [readonly]

Deprecated. Use game:GetService("Lighting") instead.

|RMD member="API:Class/DataModel/lighting"|Deprecated. Use game:GetService("Lighting") instead.|/RMD|
Workspaceworkspace [deprecated] [readonly]

Deprecated in favor of Workspace.

|RMD member="API:Class/DataModel/workspace"|Deprecated in favor of Workspace.|/RMD|
CreatorId [readonly]
The place creator's UserId.
CreatorType [readonly]
The CreatorType of the current place.
GearGenreSetting [readonly]
The type of gear that are allowed to enter the DataModel through the LocalPlayer's StarterPack.
Genre [readonly]
The game's genre.
JobId [readonly]
A unique identifier for the current game server. Defaults to the empty string in offline mode.
PlaceId [readonly]
The Asset Id of the current place.
PlaceVersion [readonly]
The version of the game that the server is running on.
VIPServerId [readonly]
A string that could identify the current server as a VIP server.
VIPServerOwnerId [readonly]
The UserId of the account who owns the VIP server.
Workspace [readonly]
A reference to the Workspace.
lighting [deprecated] [readonly]
Deprecated. Use game:GetService("Lighting") instead.
workspace [deprecated] [readonly]
Deprecated in favor of Workspace.
Inherited from Object Icon.pngInstance:
stringClassName [readonly]

The unique name of this type of Instance.

|RMD member="API:Class/Instance/ClassName"|The unique name of this type of Instance.|/RMD|
stringName

A non-unique identifier for the object.

|RMD member="API:Class/Instance/Name"|A non-unique identifier for the object.|/RMD|
boolRobloxLocked [PluginSecurity]

If true, the object and its descendants cannot be indexed or edited by a Script or LocalScript and will throw an error if it is attempted.

|RMD member="API:Class/Instance/RobloxLocked"|If true, the object and its descendants cannot be indexed or edited by a Script or LocalScript and will throw an error if it is attempted.|/RMD|
intDataCost [RobloxPlaceSecurity] [deprecated] [readonly]

The cost of saving the instance using Data Persistence.

|RMD member="API:Class/Instance/DataCost"|The cost of saving the instance using Data Persistence.|/RMD|
boolarchivable [deprecated] [hidden]

Deprecated in favor of Archivable.

|RMD member="API:Class/Instance/archivable"|Deprecated in favor of Archivable.|/RMD|
stringclassName [deprecated] [readonly]

Deprecated in favor of ClassName.

|RMD member="API:Class/Instance/className"|Deprecated in favor of ClassName.|/RMD|
ClassName [readonly]
The unique name of this type of Instance.
A non-unique identifier for the object.
RobloxLocked [PluginSecurity]
If true, the object and its descendants cannot be indexed or edited by a Script or LocalScript and will throw an error if it is attempted.
DataCost [RobloxPlaceSecurity] [deprecated] [readonly]
The cost of saving the instance using Data Persistence.
archivable [deprecated] [hidden]
Deprecated in favor of Archivable.
className [deprecated] [readonly]
Deprecated in favor of ClassName.

Functions

FunctionsmemberhiddenFunctions [toggle]

voidAddStat ( string displayName, string stat ) [LocalUserSecurity]

Adds a statistic display to the Custom stats menu, which targets the statistic stat.

|RMD member="API:Class/DataModel/AddStat"|Adds a statistic display to the Custom stats menu, which targets the statistic stat.|/RMD|
voidBindToClose ( function function )

Schedules the given function to be called when the game is about to shut down.

|RMD member="API:Class/DataModel/BindToClose"|Schedules the given function to be called when the game is about to shut down.|/RMD|
voidClearContent ( bool resettingSimulation ) [LocalUserSecurity] [StudioOnly]

Clears the DataModel to a clean state. If resettingSimulation is true, the Workspace will be cleared as well.

|RMD member="API:Class/DataModel/ClearContent"|Clears the DataModel to a clean state.

If resettingSimulation is true, the Workspace will be cleared as well.|/RMD|

doubleGetJobIntervalPeakFraction ( string jobname, double greaterThan ) [PluginSecurity]

Returns the job interval peak fraction of the specified task scheduler job.

|RMD member="API:Class/DataModel/GetJobIntervalPeakFraction"|Returns the job interval peak fraction of the specified task scheduler job.|/RMD|
doubleGetJobTimePeakFraction ( string jobname, double greaterThan ) [PluginSecurity]

Returns the job time peak fraction of the specified task scheduler job.

|RMD member="API:Class/DataModel/GetJobTimePeakFraction"|Returns the job time peak fraction of the specified task scheduler job.|/RMD|
array<array<string, Tuple<float>>>GetJobsExtendedStats ( ) [PluginSecurity]

Returns a table containing the jobs performed by the game, and one reference table.

|RMD member="API:Class/DataModel/GetJobsExtendedStats"|Returns a table containing the jobs performed by the game, and one reference table.|/RMD|
array<array<string, float, float, float, float, bool>>GetJobsInfo ( ) [PluginSecurity]

Returns a table containing the jobs performed by the game, and one reference table.

|RMD member="API:Class/DataModel/GetJobsInfo"|Returns a table containing the jobs performed by the game, and one reference table.|/RMD|
array<Instance>GetObjects ( Content url ) [LocalUserSecurity] [StudioOnly]

Returns an array of Instances based on the specified content url. The url should point to a model asset.

|RMD member="API:Class/DataModel/GetObjects"|Returns an array of Instances based on the specified content url.

The url should point to a model asset.|/RMD|

boolIsGearTypeAllowed ( GearType gearType )

Returns true if the GearType is allowed to enter the game through a client's StarterPack.

|RMD member="API:Class/DataModel/IsGearTypeAllowed"|Returns true if the GearType is allowed to enter the game through a client's StarterPack.|/RMD|
boolIsLoaded ( )

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

|RMD member="API:Class/DataModel/IsLoaded"|Returns true if the game has finished loading for the first time.|/RMD|
voidLoad ( Content url ) [LocalUserSecurity]

Loads a Roblox Place File from a URL.

|RMD member="API:Class/DataModel/Load"|Loads a Roblox Place File from a URL.|/RMD|
voidRemoveStat ( string stat ) [LocalUserSecurity]

Removes the stat labeled stat from the custom stats menu.

|RMD member="API:Class/DataModel/RemoveStat"|Removes the stat labeled stat from the custom stats menu.|/RMD|
voidSaveStats ( ) [LocalUserSecurity]

Persistently saves any stats that were added using AddStat.

|RMD member="API:Class/DataModel/SaveStats"|Persistently saves any stats that were added using AddStat.|/RMD|
voidServerSave ( ) [LocalUserSecurity]

Uploads the place to the URL set by SetServerSaveUrl.

|RMD member="API:Class/DataModel/ServerSave"|Uploads the place to the URL set by SetServerSaveUrl.|/RMD|
voidSetCreatorId ( int creatorId, CreatorType creatorType ) [PluginSecurity]

Sets the DataModel's CreatorId and CreatorType.

|RMD member="API:Class/DataModel/SetCreatorId"|Sets the DataModel's CreatorId and CreatorType.|/RMD|
voidSetGearSettings ( GearGenreSetting genreRestriction, int allowedGenres ) [PluginSecurity]

Sets the game's gear settings.

|RMD member="API:Class/DataModel/SetGearSettings"|Sets the game's gear settings.|/RMD|
voidSetGenre ( Genre genre ) [PluginSecurity]

Sets the game's Genre.

|RMD member="API:Class/DataModel/SetGenre"|Sets the game's Genre.|/RMD|
voidSetJobsExtendedStatsWindow ( double seconds ) [LocalUserSecurity]

Sets the extended stats window of the task scheduler.

|RMD member="API:Class/DataModel/SetJobsExtendedStatsWindow"|Sets the extended stats window of the task scheduler.|/RMD|
voidSetPlaceId ( int placeId, bool robloxPlace = false ) [PluginSecurity]

Sets the DataModel's PlaceId to placeId.

|RMD member="API:Class/DataModel/SetPlaceId"|Sets the DataModel's PlaceId to placeId.|/RMD|
voidSetPlaceVersion ( int placeId ) [PluginSecurity]

Sets the DataModel's PlaceVersion property.

|RMD member="API:Class/DataModel/SetPlaceVersion"|Sets the DataModel's PlaceVersion property.|/RMD|
voidSetScreenshotInfo ( string info ) [LocalUserSecurity]

Sets the information used by the client when you upload a screenshot to Roblox through the game.

|RMD member="API:Class/DataModel/SetScreenshotInfo"|Sets the information used by the client when you upload a screenshot to Roblox through the game.|/RMD|
voidSetServerSaveUrl ( string url ) [LocalUserSecurity]

Sets the upload URL for the ServerSave function.

|RMD member="API:Class/DataModel/SetServerSaveUrl"|Sets the upload URL for the ServerSave function.|/RMD|
voidSetUniverseId ( int universeId ) [PluginSecurity]

Sets the ID of the universe this game belongs to.

|RMD member="API:Class/DataModel/SetUniverseId"|Sets the ID of the universe this game belongs to.|/RMD|
voidSetVIPServerId ( string newId ) [LocalUserSecurity]

Sets the VIPServerId for this server.

|RMD member="API:Class/DataModel/SetVIPServerId"|Sets the VIPServerId for this server.|/RMD|
voidSetVIPServerOwnerId ( int newId ) [LocalUserSecurity]

Sets the game's VIPServerOwnerId.

|RMD member="API:Class/DataModel/SetVIPServerOwnerId"|Sets the game's VIPServerOwnerId.|/RMD|
voidSetVideoInfo ( string info ) [LocalUserSecurity]

Sets the XML information used by the client when you upload a video to YouTube through ROBLOX.

|RMD member="API:Class/DataModel/SetVideoInfo"|Sets the XML information used by the client when you upload a video to YouTube through ROBLOX.|/RMD|
voidShutdown ( ) [LocalUserSecurity]

Closes the current Roblox Instance.

|RMD member="API:Class/DataModel/Shutdown"|Closes the current Roblox Instance.|/RMD|
stringGetMessage ( ) [deprecated]

(OBSOLETE) Always returns a blank string.

|RMD member="API:Class/DataModel/GetMessage"|(OBSOLETE) Always returns a blank string.|/RMD|
boolGetRemoteBuildMode ( ) [deprecated]

This method is no longer useful and will always return false. Use RunService:IsServer() to see if your code is running on the server.

|RMD member="API:Class/DataModel/GetRemoteBuildMode"|This method is no longer useful and will always return false. Use RunService:IsServer() to see if your code is running on the server.|/RMD|
voidSetCreatorID ( int creatorID, CreatorType creatorType ) [PluginSecurity] [deprecated]

Deprecated in favor of SetCreatorId.

|RMD member="API:Class/DataModel/SetCreatorID"|Deprecated in favor of SetCreatorId.|/RMD|
voidSetPlaceID ( int placeID, bool robloxPlace = false ) [PluginSecurity] [deprecated]

Deprecated in favor of SetPlaceId.

|RMD member="API:Class/DataModel/SetPlaceID"|Deprecated in favor of SetPlaceId.|/RMD|
array<Instance>get ( Content url ) [LocalUserSecurity] [StudioOnly] [deprecated]

Deprecated in favor of GetObjects.

|RMD member="API:Class/DataModel/get"|Deprecated in favor of GetObjects.|/RMD|
AddStat ( string displayName, string stat ) [LocalUserSecurity]
Adds a statistic display to the Custom stats menu, which targets the statistic stat.
BindToClose ( function function )
Schedules the given function to be called when the game is about to shut down.
ClearContent ( bool resettingSimulation ) [LocalUserSecurity] [StudioOnly]
Clears the DataModel to a clean state. If resettingSimulation is true, the Workspace will be cleared as well.
GetJobIntervalPeakFraction ( string jobname, double greaterThan ) [PluginSecurity]
Returns the job interval peak fraction of the specified task scheduler job.
GetJobTimePeakFraction ( string jobname, double greaterThan ) [PluginSecurity]
Returns the job time peak fraction of the specified task scheduler job.
GetJobsExtendedStats ( ) [PluginSecurity]
Returns a table containing the jobs performed by the game, and one reference table.
GetJobsInfo ( ) [PluginSecurity]
Returns a table containing the jobs performed by the game, and one reference table.
GetObjects ( Content url ) [LocalUserSecurity] [StudioOnly]
Returns an array of Instances based on the specified content url. The url should point to a model asset.
Returns true if the GearType is allowed to enter the game through a client's StarterPack.
Returns true if the game has finished loading for the first time.
Load ( Content url ) [LocalUserSecurity]
Loads a Roblox Place File from a URL.
RemoveStat ( string stat ) [LocalUserSecurity]
Removes the stat labeled stat from the custom stats menu.
SaveStats ( ) [LocalUserSecurity]
Persistently saves any stats that were added using AddStat.
ServerSave ( ) [LocalUserSecurity]
Uploads the place to the URL set by SetServerSaveUrl.
SetCreatorId ( int creatorId, CreatorType creatorType ) [PluginSecurity]
Sets the DataModel's CreatorId and CreatorType.
SetGearSettings ( GearGenreSetting genreRestriction, int allowedGenres ) [PluginSecurity]
Sets the game's gear settings.
SetGenre ( Genre genre ) [PluginSecurity]
Sets the game's Genre.
SetJobsExtendedStatsWindow ( double seconds ) [LocalUserSecurity]
Sets the extended stats window of the task scheduler.
SetPlaceId ( int placeId, bool robloxPlace = false ) [PluginSecurity]
Sets the DataModel's PlaceId to placeId.
SetPlaceVersion ( int placeId ) [PluginSecurity]
Sets the DataModel's PlaceVersion property.
SetScreenshotInfo ( string info ) [LocalUserSecurity]
Sets the information used by the client when you upload a screenshot to Roblox through the game.
SetServerSaveUrl ( string url ) [LocalUserSecurity]
Sets the upload URL for the ServerSave function.
SetUniverseId ( int universeId ) [PluginSecurity]
Sets the ID of the universe this game belongs to.
SetVIPServerId ( string newId ) [LocalUserSecurity]
Sets the VIPServerId for this server.
SetVIPServerOwnerId ( int newId ) [LocalUserSecurity]
Sets the game's VIPServerOwnerId.
SetVideoInfo ( string info ) [LocalUserSecurity]
Sets the XML information used by the client when you upload a video to YouTube through ROBLOX.
Shutdown ( ) [LocalUserSecurity]
Closes the current Roblox Instance.
GetMessage ( ) [deprecated]
(OBSOLETE) Always returns a blank string.
GetRemoteBuildMode ( ) [deprecated]
This method is no longer useful and will always return false. Use RunService:IsServer() to see if your code is running on the server.
SetCreatorID ( int creatorID, CreatorType creatorType ) [PluginSecurity] [deprecated]
Deprecated in favor of SetCreatorId.
SetPlaceID ( int placeID, bool robloxPlace = false ) [PluginSecurity] [deprecated]
Deprecated in favor of SetPlaceId.
get ( Content url ) [LocalUserSecurity] [StudioOnly] [deprecated]
Deprecated in favor of GetObjects.
Inherited from Object Icon.pngServiceProvider:
InstanceFindService ( string className )

Returns the service specified by the given className if it's already created, errors for an invalid name.

|RMD member="API:Class/ServiceProvider/FindService"|Returns the service specified by the given className if it's already created, errors for an invalid name.|/RMD|
Variant<Instance, nil>GetService ( string className )

Returns the service with the requested class name, creating it if it does not exist.

|RMD member="API:Class/ServiceProvider/GetService"|Returns the service with the requested class name, creating it if it does not exist.|/RMD|
Variant<Instance, nil>getService ( string className ) [deprecated]

Deprecated in favor of GetService.

|RMD member="API:Class/ServiceProvider/getService"|Deprecated in favor of GetService.|/RMD|
Variant<Instance, nil>service ( string className ) [deprecated]

Deprecated in favor of GetService.

|RMD member="API:Class/ServiceProvider/service"|Deprecated in favor of GetService.|/RMD|
FindService ( string className )
Returns the service specified by the given className if it's already created, errors for an invalid name.
GetService ( string className )
Returns the service with the requested class name, creating it if it does not exist.
getService ( string className ) [deprecated]
Deprecated in favor of GetService.
service ( string className ) [deprecated]
Deprecated in favor of GetService.
Inherited from Object Icon.pngInstance:
Variant<Instance, nil>FindFirstChildOfClass ( string className )

Returns the first Instance whose ClassName is equal to className, or nil, if no such object is found with that ClassName.

|RMD member="API:Class/Instance/FindFirstChildOfClass"|Returns the first Instance whose ClassName is equal to className, or nil, if no such object is found with that ClassName.|/RMD|
array<Instance>GetChildren ( )

Returns an array of the object's children.

|RMD member="API:Class/Instance/GetChildren"|Returns an array of the object's children.|/RMD|
stringGetDebugId ( int scopeLength = 4 ) [PluginSecurity] [notbrowsable]

Returns a coded string of the object's DebugId used internally by Roblox.

|RMD member="API:Class/Instance/GetDebugId"|Returns a coded string of the object's DebugId used internally by Roblox.|/RMD|
stringGetFullName ( )

Returns a string which shows the object's ancestry chain.

|RMD member="API:Class/Instance/GetFullName"|Returns a string which shows the object's ancestry chain.|/RMD|
RBXScriptSignalGetPropertyChangedSignal ( string property )

Returns a signal that is fired when the specified property is changed on this object.

|RMD member="API:Class/Instance/GetPropertyChangedSignal"|Returns a signal that is fired when the specified property is changed on this object.|/RMD|
boolIsA ( string className )

Returns true if the object is an instance of the given class, or if the object's class inherits from the given class.

|RMD member="API:Class/Instance/IsA"|Returns true if the object is an instance of the given class, or if the object's class inherits from the given class.|/RMD|
boolIsDescendantOf ( Instance ancestor )

Returns true if the object is a descendant of the given ancestor.

|RMD member="API:Class/Instance/IsDescendantOf"|Returns true if the object is a descendant of the given ancestor.|/RMD|
Variant<Instance, nil>WaitForChild ( string childName, double timeOut )

Yields the current thread until a child with the given name is found, then returns the child. If the timeOut parameter is specified, this function will drop out and return nil if the timeOut is exceeded. .

|RMD member="API:Class/Instance/WaitForChild"|Yields the current thread until a child with the given name is found, then returns the child.

If the timeOut parameter is specified, this function will drop out and return nil if the timeOut is exceeded. .|/RMD|

voidRemove ( ) [deprecated]

Sets the object's Parent to nil, and does the same for all its descendants.

|RMD member="API:Class/Instance/Remove"|Sets the object's Parent to nil, and does the same for all its descendants.|/RMD|
array<Instance>children ( ) [deprecated]

Deprecated in favor of GetChildren.

|RMD member="API:Class/Instance/children"|Deprecated in favor of GetChildren.|/RMD|
Variant<Instance, nil>clone ( ) [deprecated]

Deprecated in favor of Clone.

|RMD member="API:Class/Instance/clone"|Deprecated in favor of Clone.|/RMD|
voiddestroy ( ) [deprecated]

Deprecated in favor of Destroy.

|RMD member="API:Class/Instance/destroy"|Deprecated in favor of Destroy.|/RMD|
Variant<Instance, nil>findFirstChild ( string name, bool recursive = false ) [deprecated]

Deprecated in favor of FindFirstChild.

|RMD member="API:Class/Instance/findFirstChild"|Deprecated in favor of FindFirstChild.|/RMD|
array<Instance>getChildren ( ) [deprecated]

Deprecated in favor of GetChildren.

|RMD member="API:Class/Instance/getChildren"|Deprecated in favor of GetChildren.|/RMD|
boolisA ( string className ) [deprecated]

Deprecated in favor of IsA.

|RMD member="API:Class/Instance/isA"|Deprecated in favor of IsA.|/RMD|
boolisDescendantOf ( Instance ancestor ) [deprecated]

Deprecated in favor of IsDescendantOf.

|RMD member="API:Class/Instance/isDescendantOf"|Deprecated in favor of IsDescendantOf.|/RMD|
voidremove ( ) [deprecated]

Deprecated in favor of Remove.

|RMD member="API:Class/Instance/remove"|Deprecated in favor of Remove.|/RMD|
Returns the first Instance whose ClassName is equal to className, or nil, if no such object is found with that ClassName.
Returns an array of the object's children.
GetDebugId ( int scopeLength = 4 ) [PluginSecurity] [notbrowsable]
Returns a coded string of the object's DebugId used internally by Roblox.
Returns a string which shows the object's ancestry chain.
Returns a signal that is fired when the specified property is changed on this object.
IsA ( string className )
Returns true if the object is an instance of the given class, or if the object's class inherits from the given class.
Returns true if the object is a descendant of the given ancestor.
WaitForChild ( string childName, double timeOut )
Yields the current thread until a child with the given name is found, then returns the child.

If the timeOut parameter is specified, this function will drop out and return nil if the timeOut is exceeded.

.
Remove ( ) [deprecated]
Sets the object's Parent to nil, and does the same for all its descendants.
children ( ) [deprecated]
Deprecated in favor of GetChildren.
clone ( ) [deprecated]
Deprecated in favor of Clone.
destroy ( ) [deprecated]
Deprecated in favor of Destroy.
findFirstChild ( string name, bool recursive = false ) [deprecated]
Deprecated in favor of FindFirstChild.
getChildren ( ) [deprecated]
Deprecated in favor of GetChildren.
isA ( string className ) [deprecated]
Deprecated in favor of IsA.
isDescendantOf ( Instance ancestor ) [deprecated]
Deprecated in favor of IsDescendantOf.
remove ( ) [deprecated]
Deprecated in favor of Remove.

YieldFunctions

YieldFunctionsmemberhiddenYieldFunctions [toggle]

boolSavePlace ( SaveFilter saveFilter = SaveAll ) [deprecated]

Saves the current place.

|RMD member="API:Class/DataModel/SavePlace"|Saves the current place.|/RMD|
SavePlace ( SaveFilter saveFilter = SaveAll ) [deprecated]
Saves the current place.

Callbacks

CallbacksmemberhiddenCallbacks [toggle]

voidOnClose ( ) [deprecated]

Invoked before the game is shut down. When this callback returns (and there are no functions still running from BindToClose), or the timeout period is hit, the game finishes shutting down.

|RMD member="API:Class/DataModel/OnClose"|Invoked before the game is shut down. When this callback returns (and there are no functions still running from BindToClose), or the timeout period is hit, the game finishes shutting down.|/RMD|
OnClose ( ) [deprecated]
Invoked before the game is shut down. When this callback returns (and there are no functions still running from BindToClose), or the timeout period is hit, the game finishes shutting down.

Events

EventsmemberhiddenEvents [toggle]

GraphicsQualityChangeRequest ( bool betterQuality )

Fired when the user wants to increase/decrease the graphics quality.

|RMD member="API:Class/DataModel/GraphicsQualityChangeRequest"|Fired when the user wants to increase/decrease the graphics quality.|/RMD|
Loaded ( )

Fires when the game is loaded for the first time.

|RMD member="API:Class/DataModel/Loaded"|Fires when the game is loaded for the first time.|/RMD|
AllowedGearTypeChanged ( ) [deprecated]

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

|RMD member="API:Class/DataModel/AllowedGearTypeChanged"|Fires when SetGearSettings is called with a different value for allowedGenres.|/RMD|
ItemChanged ( Instance object, string descriptor ) [deprecated]

Fires when a property of any object in the DataModel is changed.

|RMD member="API:Class/DataModel/ItemChanged"|Fires when a property of any object in the DataModel is changed.|/RMD|
Fired when the user wants to increase/decrease the graphics quality.
Loaded ( )
Fires when the game is loaded for the first time.
AllowedGearTypeChanged ( ) [deprecated]
Fires when SetGearSettings is called with a different value for allowedGenres.
ItemChanged ( Instance object, string descriptor ) [deprecated]
Fires when a property of any object in the DataModel is changed.
Inherited from Object Icon.pngServiceProvider:
Close ( )

Fires when the current place is exited.

|RMD member="API:Class/ServiceProvider/Close"|Fires when the current place is exited.|/RMD|
CloseLate ( ) [LocalUserSecurity]

Fired immediately after the Close signal is fired.

|RMD member="API:Class/ServiceProvider/CloseLate"|Fired immediately after the Close signal is fired.|/RMD|
ServiceAdded ( Instance service )

Fired when a service is created.

|RMD member="API:Class/ServiceProvider/ServiceAdded"|Fired when a service is created.|/RMD|
ServiceRemoving ( Instance service )

Fired when a service is about to be removed.

|RMD member="API:Class/ServiceProvider/ServiceRemoving"|Fired when a service is about to be removed.|/RMD|
Close ( )
Fires when the current place is exited.
CloseLate ( ) [LocalUserSecurity]
Fired immediately after the Close signal is fired.
Fired when a service is created.
Fired when a service is about to be removed.
Inherited from Object Icon.pngInstance:
Changed ( string property )

Fires when a property of the object changes.

|RMD member="API:Class/Instance/Changed"|Fires when a property of the object changes.|/RMD|
DescendantAdded ( Instance descendant )

Fires when a descendant is added to the object.

|RMD member="API:Class/Instance/DescendantAdded"|Fires when a descendant is added to the object.|/RMD|
DescendantRemoving ( Instance descendant )

Fires before a descendant of the object is removed.

|RMD member="API:Class/Instance/DescendantRemoving"|Fires before a descendant of the object is removed.|/RMD|
childAdded ( Instance child ) [deprecated]

Deprecated in favor of ChildAdded.

|RMD member="API:Class/Instance/childAdded"|Deprecated in favor of ChildAdded.|/RMD|
Changed ( string property )
Fires when a property of the object changes.
DescendantAdded ( Instance descendant )
Fires when a descendant is added to the object.
Fires before a descendant of the object is removed.
childAdded ( Instance child ) [deprecated]
Deprecated in favor of ChildAdded.

|RMD member="API:Class/DataModel"|The DataModel (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 the services such as the Workspace and Lighting in a game that act as containers for everything else, and also some services that aren't used for containing things and are hidden from the browser for this reason. Every object that currently "exists" in the game hierarchy will have the DataModel as its ultimate ancestor.
The DataModel's own members are for looking at or altering properties of the currently running game. |/RMD|


Example

game.Workspace.Part:Destroy() --'game' is a reference to the DataModel

Trivia

  • If there is a StringValue named DefaultToolboxSearch inside of the DataModel when the game is loaded, the toolbox in Roblox Studio will automatically search for what it's value is.