This site is inactive!

This site is no longer kept up to date. It has been superseded by the Roblox API Reference. Please update your bookmarks.

The DataModel class represents the root of the game hierarchy and the game itself. It contains all the game services and is a service provider because of this.

Members

Functions

Returns Function History
void ActivateExperimentalFeatures ( ) (+0.122, −0.128)
void AddStat ( string displayName, string stat ) (+0.91, −0.310)
void BindToClose ( Function function ) (+0.264)
void ClearContent ( bool resettingSimulation ) (−0.217)
void ClearMessage ( ) (−0.273)
void FinishShutdown ( bool localSave ) (−0.310)
double GetJobIntervalPeakFraction ( string jobname, double greaterThan )
double GetJobTimePeakFraction ( string jobname, double greaterThan )
Array GetJobsExtendedStats ( )
Array GetJobsInfo ( )
Objects GetObjects ( Content url ) (−0.215)
string HttpGet ( string url, bool synchronous = false, HttpRequestType httpRequestType = Default, bool doNotAllowDiabolicalMode = false ) (−0.331)
string HttpPost ( string url, string data, bool synchronous = false, string contentType = */*, HttpRequestType httpRequestType = Default, bool doNotAllowDiabolicalMode = false ) (−0.331)
bool IsGearTypeAllowed ( GearType gearType )
bool IsLoaded ( ) (+0.80)
void Load ( Content url )
void LoadGame ( int assetID ) (+0.118, −0.296)
void LoadPlugins ( ) (−0.310)
void LoadWorld ( int assetID ) (+0.118, −0.296)
void Loaded ( ) (+0.132, −0.147)
void OpenScreenshotsFolder ( ) (+0.287)
void OpenVideosFolder ( ) (+0.292)
void RemoveStat ( string stat ) (+0.91, −0.310)
void ReportInGoogleAnalytics ( string category, string action = custom, string label = none, int value = 0 ) (+0.170)
void ReportMeasurement ( string id, string key1, string value1, string key2, string value2 ) (−0.310)
void Save ( Content url ) (−0.310)
void SavePlace ( SaveFilter saveFilter = SaveAll ) (+0.115, −0.118)
void SaveStats ( ) (+0.91, −0.310)
void ServerSave ( ) (−0.310)
void SetCreatorId ( int creatorId, CreatorType creatorType ) (−0.311)
void SetGameInstanceId ( string instanceID ) (+0.236, −0.238)
void SetGearSettings ( GearGenreSetting genreRestriction, int allowedGenres ) (−0.311)
void SetGenre ( Genre genre ) (−0.311)
void SetJobsExtendedStatsWindow ( double seconds ) (−0.310)
void SetMessage ( string message ) (−0.273)
void SetMessageBrickCount ( ) (−0.273)
void SetPlaceId ( int placeId, bool robloxPlace = false ) (−0.311)
void SetPlaceVersion ( int placeId ) (+0.120, −0.311)
void SetRemoteBuildMode ( bool buildModeEnabled ) (−0.273)
void SetScreenshotInfo ( string info ) (−0.311)
void SetServerSaveUrl ( string url ) (−0.310)
void SetUniverseId ( int universeId ) (+0.173, −0.311)
void SetVIPServerId ( string newId ) (+0.181, −0.310)
void SetVIPServerOwnerId ( int newId ) (+0.210, −0.310)
void SetVideoInfo ( string info ) (−0.311)
void Shutdown ( )
void ToggleTools ( ) (−0.273)
string GetMessage ( ) (+0.154)
bool GetRemoteBuildMode ( )
void SetCreatorID ( int creatorID, CreatorType creatorType ) (−0.311)
void SetPlaceID ( int placeID, bool robloxPlace = false ) (−0.311)
Objects get ( Content url ) (−0.215)

YieldFunctions

Returns YieldFunction History
int CreatePlace ( string placeName, int templatePlaceID ) (+0.131, −0.153)
string HttpGetAsync ( string url, HttpRequestType httpRequestType = Default, bool doNotAllowDiabolicalMode = false )
string HttpPostAsync ( string url, string data, string contentType = */*, HttpRequestType httpRequestType = Default, bool doNotAllowDiabolicalMode = false )
bool SaveToRoblox ( ) (−0.310)
bool SavePlace ( SaveFilter saveFilter = SaveAll ) (+0.118)
  • 1 yieldfunction inherited from Instance

Events

Event History
GraphicsQualityChangeRequest ( bool betterQuality )
Loaded ( ) (+0.80)
SavePlaceFinished ( bool succeeded, string errorString ) (+0.115, −0.118)
ScreenshotReady ( string path ) (+0.287)
AllowedGearTypeChanged ( )
ItemChanged ( Instance object, Property descriptor )

Callbacks

Returns Callback History
bool RequestShutdown ( ) (−0.310)
Tuple OnClose ( ) (+0.143)

Detailed Description

All instances of ROBLOX games contain a singleton DataModel object which does not replicate and gives access to all the game services. The DataModel object can be accessed by scripts with the game variable or with the Game variable. These two variables are part of the global environment. The DataModel object provides many members related to the game itself. Those are particularly useful to get information about the game; examples of such members are the PlaceId and CreatorId properties.

Property Descriptions

int64 DataModel.CreatorId

Tags: readonly

This is the identifier of the user who owns the place. In offline games, this property has the value 0.

CreatorType DataModel.CreatorType

Tags: readonly

This indicates whether the place belongs to a user or to a group. Group places are not used anymore and this property is not very useful anymore, although group places still exist. They are now difficult to find and cannot be used.

int64 DataModel.GameId

Version History:(+0.304)

Tags: readonly

GearGenreSetting DataModel.GearGenreSetting

Tags: readonly

This indicates whether gear that can be used in the game is restricted to gear that match the game's genre or not.

Genre DataModel.Genre

Tags: readonly

This is the genre of the place.

bool DataModel.IsPersonalServer

Version History:(−0.273)

Tags: RobloxScriptSecurity

This indicates whether the game is a personal server.

bool DataModel.IsSFFlagsLoaded

Version History:(+0.256)

Tags: RobloxScriptSecurity, readonly

string DataModel.JobId

Tags: readonly

This is an identifier unique to the current game server. It can be used to identify the game server externally, for example when servers are communicating with a web server using HttpService. Example: 74829c09-ef44-483b-bdda-138bbd704f4b.

bool DataModel.LocalSaveEnabled

Version History:(−0.273)

Tags: RobloxScriptSecurity, readonly

int64 DataModel.PlaceId

Tags: readonly

This is the identifier of the place to which the game server belongs. It is 0 in offline games.

int DataModel.PlaceVersion

Version History:(+0.120)

Tags: readonly

This is the version of the current place. It corresponds to the version number given in the version history configuration page of the place, and is incremented of 1 each time the game is updated. It can be used to compare the recency of servers that need to communicate with a web server using HttpService.

string DataModel.PrivateServerId

Version History:(+0.352)

Tags: readonly

int64 DataModel.PrivateServerOwnerId

Version History:(+0.352)

Tags: readonly

Class:Workspace DataModel.Workspace

Tags: readonly

This is a reference to the Workspace service.

bool DataModel.ShowMouse

Version History:(−0.49)

Deprecated: This member is deprecated.

Tags: RobloxScriptSecurity, hidden

string DataModel.VIPServerId

Version History:(+0.181)

Deprecated: This member is deprecated.

Tags: hidden, readonly

int64 DataModel.VIPServerOwnerId

Version History:(+0.210)

Deprecated: This member is deprecated.

Tags: hidden, readonly

Class:Instance DataModel.lighting

Version History:(+0.68)

Deprecated: This member is deprecated.

Tags: readonly

Class:Workspace DataModel.workspace

Deprecated: This member is deprecated.

Tags: readonly

Function Descriptions

voidDataModel.ActivateExperimentalFeatures ( )

Version History:(+0.122, −0.128)

Tags: RobloxSecurity

voidDataModel.AddStat ( string displayName, string stat )

Version History:(+0.91, −0.310)

Tags: LocalUserSecurity

voidDataModel.BindToClose ( Function function )

Version History:(+0.264)

voidDataModel.ClearContent ( bool resettingSimulation )

Version History:(−0.217)

Tags: LocalUserSecurity

voidDataModel.ClearMessage ( )

Version History:(−0.273)

Tags: LocalUserSecurity

voidDataModel.FinishShutdown ( bool localSave )

Version History:(−0.310)

Tags: RobloxScriptSecurity

doubleDataModel.GetJobIntervalPeakFraction ( string jobname, double greaterThan )

Tags: PluginSecurity

doubleDataModel.GetJobTimePeakFraction ( string jobname, double greaterThan )

Tags: PluginSecurity

ArrayDataModel.GetJobsExtendedStats ( )

Tags: PluginSecurity

ArrayDataModel.GetJobsInfo ( )

Tags: PluginSecurity

ObjectsDataModel.GetObjects ( Content url )

Version History:(−0.215)

Tags: PluginSecurity

stringDataModel.HttpGet ( string url, bool synchronous = false, HttpRequestType httpRequestType = Default, bool doNotAllowDiabolicalMode = false )

Version History:(−0.331)

Tags: RobloxScriptSecurity

stringDataModel.HttpPost ( string url, string data, bool synchronous = false, string contentType = */*, HttpRequestType httpRequestType = Default, bool doNotAllowDiabolicalMode = false )

Version History:(−0.331)

Tags: RobloxScriptSecurity

boolDataModel.IsGearTypeAllowed ( GearType gearType )

boolDataModel.IsLoaded ( )

Version History:(+0.80)

voidDataModel.Load ( Content url )

Tags: LocalUserSecurity

voidDataModel.LoadGame ( int assetID )

Version History:(+0.118, −0.296)

Tags: LocalUserSecurity

voidDataModel.LoadPlugins ( )

Version History:(−0.310)

Tags: RobloxSecurity

voidDataModel.LoadWorld ( int assetID )

Version History:(+0.118, −0.296)

Tags: LocalUserSecurity

voidDataModel.Loaded ( )

Version History:(+0.132, −0.147)

Tags: LocalUserSecurity

voidDataModel.OpenScreenshotsFolder ( )

Version History:(+0.287)

Tags: RobloxScriptSecurity

voidDataModel.OpenVideosFolder ( )

Version History:(+0.292)

Tags: RobloxScriptSecurity

voidDataModel.RemoveStat ( string stat )

Version History:(+0.91, −0.310)

Tags: LocalUserSecurity

voidDataModel.ReportInGoogleAnalytics ( string category, string action = custom, string label = none, int value = 0 )

Version History:(+0.170)

Tags: RobloxScriptSecurity

voidDataModel.ReportMeasurement ( string id, string key1, string value1, string key2, string value2 )

Version History:(−0.310)

Tags: RobloxScriptSecurity

voidDataModel.Save ( Content url )

Version History:(−0.310)

Tags: RobloxSecurity

voidDataModel.SavePlace ( SaveFilter saveFilter = SaveAll )

Version History:(+0.115, −0.118)

Tags: RobloxPlaceSecurity

voidDataModel.SaveStats ( )

Version History:(+0.91, −0.310)

Tags: LocalUserSecurity

voidDataModel.ServerSave ( )

Version History:(−0.310)

Tags: LocalUserSecurity

voidDataModel.SetCreatorId ( int creatorId, CreatorType creatorType )

Version History:(−0.311)

Tags: PluginSecurity

voidDataModel.SetGameInstanceId ( string instanceID )

Version History:(+0.236, −0.238)

Tags: PluginSecurity

voidDataModel.SetGearSettings ( GearGenreSetting genreRestriction, int allowedGenres )

Version History:(−0.311)

Tags: PluginSecurity

voidDataModel.SetGenre ( Genre genre )

Version History:(−0.311)

Tags: PluginSecurity

voidDataModel.SetJobsExtendedStatsWindow ( double seconds )

Version History:(−0.310)

Tags: LocalUserSecurity

voidDataModel.SetMessage ( string message )

Version History:(−0.273)

Tags: LocalUserSecurity

voidDataModel.SetMessageBrickCount ( )

Version History:(−0.273)

Tags: LocalUserSecurity

voidDataModel.SetPlaceId ( int placeId, bool robloxPlace = false )

Version History:(−0.311)

Tags: PluginSecurity

voidDataModel.SetPlaceVersion ( int placeId )

Version History:(+0.120, −0.311)

Tags: PluginSecurity

voidDataModel.SetRemoteBuildMode ( bool buildModeEnabled )

Version History:(−0.273)

Tags: LocalUserSecurity

voidDataModel.SetScreenshotInfo ( string info )

Version History:(−0.311)

Tags: LocalUserSecurity

voidDataModel.SetServerSaveUrl ( string url )

Version History:(−0.310)

Tags: LocalUserSecurity

voidDataModel.SetUniverseId ( int universeId )

Version History:(+0.173, −0.311)

Tags: PluginSecurity

voidDataModel.SetVIPServerId ( string newId )

Version History:(+0.181, −0.310)

Tags: LocalUserSecurity

voidDataModel.SetVIPServerOwnerId ( int newId )

Version History:(+0.210, −0.310)

Tags: LocalUserSecurity

voidDataModel.SetVideoInfo ( string info )

Version History:(−0.311)

Tags: LocalUserSecurity

voidDataModel.Shutdown ( )

Tags: LocalUserSecurity

voidDataModel.ToggleTools ( )

Version History:(−0.273)

Tags: LocalUserSecurity

stringDataModel.GetMessage ( )

Version History:(+0.154)

Deprecated: This member is deprecated.

boolDataModel.GetRemoteBuildMode ( )

Deprecated: This member is deprecated.

voidDataModel.SetCreatorID ( int creatorID, CreatorType creatorType )

Version History:(−0.311)

Deprecated: This member is deprecated.

Tags: PluginSecurity

voidDataModel.SetPlaceID ( int placeID, bool robloxPlace = false )

Version History:(−0.311)

Deprecated: This member is deprecated.

Tags: PluginSecurity

ObjectsDataModel.get ( Content url )

Version History:(−0.215)

Deprecated: This member is deprecated.

Tags: LocalUserSecurity

YieldFunction Descriptions

intDataModel.CreatePlace ( string placeName, int templatePlaceID )

Version History:(+0.131, −0.153)

stringDataModel.HttpGetAsync ( string url, HttpRequestType httpRequestType = Default, bool doNotAllowDiabolicalMode = false )

Tags: RobloxScriptSecurity

stringDataModel.HttpPostAsync ( string url, string data, string contentType = */*, HttpRequestType httpRequestType = Default, bool doNotAllowDiabolicalMode = false )

Tags: RobloxScriptSecurity

boolDataModel.SaveToRoblox ( )

Version History:(−0.310)

Tags: RobloxScriptSecurity

boolDataModel.SavePlace ( SaveFilter saveFilter = SaveAll )

Version History:(+0.118)

Deprecated: This member is deprecated.

Event Descriptions

DataModel.GraphicsQualityChangeRequest ( bool betterQuality )

DataModel.Loaded ( )

Version History:(+0.80)

DataModel.SavePlaceFinished ( bool succeeded, string errorString )

Version History:(+0.115, −0.118)

Tags: RobloxPlaceSecurity

DataModel.ScreenshotReady ( string path )

Version History:(+0.287)

Tags: RobloxScriptSecurity

DataModel.AllowedGearTypeChanged ( )

Deprecated: This member is deprecated.

DataModel.ItemChanged ( Instance object, Property descriptor )

Deprecated: This member is deprecated.

Callback Descriptions

boolDataModel.RequestShutdown ( )

Version History:(−0.310)

Tags: RobloxScriptSecurity, noyield

TupleDataModel.OnClose ( )

Version History:(+0.143)

Deprecated: This member is deprecated.

Inherited by: