FANDOM


The root of Roblox's parent-child hierarchy (commonly known as game after the global variable used to access it).

Properties

Pubfield int64 CreatorId

The UserId of the game creator, or GroupId if creator is a group.

Example:

local id = game.CreatorIdif id == 261 then
    print("Game is owned by Shedletsky")
end

Category: State.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Pubfield CreatorType CreatorType

An enum which defines whether the game is owned by a user or group.

Category: State.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Pubfield int64 GameId

Category: State.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Pubfield GearGenreSetting GearGenreSetting

Category: State.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated, Deprecated.

Pubfield Genre Genre

Category: State.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Protfield bool IsSFFlagsLoaded

Category: Data.

Read security: RobloxScriptSecurity.

Write security: RobloxScriptSecurity.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Pubfield string JobId

Category: JobInfo.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Pubfield int64 PlaceId

The id of the place.

Category: State.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Pubfield int PlaceVersion

Category: State.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Pubfield string PrivateServerId

Category: Data.

Serialization: can save only.

Tags: ReadOnly, NotReplicated.

Pubfield int64 PrivateServerOwnerId

Category: Data.

Serialization: can save only.

Tags: ReadOnly, NotReplicated.

Pubfield string VIPServerId

A unique identifier of the vip server. This will be nil if the server is not a VIP server.

Category: Data.

Serialization: can save only.

Tags: Hidden, ReadOnly, NotReplicated, Deprecated.

Pubfield int64 VIPServerOwnerId

The UserId of the vip server owner.

Category: Data.

Serialization: can save only.

Tags: Hidden, ReadOnly, NotReplicated, Deprecated.

Pubfield Workspace Workspace

The game's ExplorerImageIndex 19Workspace.

Category: Data.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated.

Pubfield Instance lighting

Deprecated. Use game.Lighting instead.

Category: Data.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated, Deprecated.

Pubfield Workspace workspace

Deprecated. Use Workspace, or the workspace keyword.

Category: Data.

Serialization: cannot load or save.

Tags: ReadOnly, NotReplicated, Deprecated.

Functions

Pubmethod void BindToClose(Function function)

Binds a function to run when the game server is about to be shutdown (Shutdown All Servers button is pressed).

Example:

local onClose = function()
    print(2+3)
    wait(2)
    print("Game is ready to close!")
end
game:BindToClose(onClose)

Protmethod bool DefineFastFlag(string name, bool defaultValue)

Security: RobloxScriptSecurity.

Protmethod int DefineFastInt(string name, int defaultValue)

Security: RobloxScriptSecurity.

Protmethod string DefineFastString(string name, string defaultValue)

Security: RobloxScriptSecurity.

Protmethod bool GetFastFlag(string name)

Security: RobloxScriptSecurity.

Protmethod int GetFastInt(string name)

Security: RobloxScriptSecurity.

Protmethod string GetFastString(string name)

Security: RobloxScriptSecurity.

Protmethod double GetJobIntervalPeakFraction(string jobname, double greaterThan)

Security: PluginSecurity.

Protmethod double GetJobTimePeakFraction(string jobname, double greaterThan)

Security: PluginSecurity.

Protmethod Array GetJobsExtendedStats()

Security: PluginSecurity.

Protmethod Array GetJobsInfo()

Security: PluginSecurity.

Pubmethod string GetMessage()

Tags: Deprecated.

Protmethod Objects GetObjects(Content url)

Security: PluginSecurity.

Protmethod Objects GetObjectsAsync(Content url)

Security: RobloxScriptSecurity.

Tags: Yields.

Protmethod Array GetObjectsList(Array urls)

Security: RobloxScriptSecurity.

Pubmethod bool GetRemoteBuildMode()

Tags: Deprecated.

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

Security: RobloxScriptSecurity.

Tags: Yields.

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

Security: RobloxScriptSecurity.

Tags: Yields.

Pubmethod bool IsGearTypeAllowed(GearType gearType)

Returns whether or not the given GearType is allowed in this place.

Tags: Deprecated.

Pubmethod bool IsLoaded()

Returns true if the game has finished loading, false otherwise. Check this before listening to the Loaded signal to ensure a script knows when a game finishes loading.

Protmethod void Load(Content url)

Security: LocalUserSecurity.

Protmethod void OpenScreenshotsFolder()

Causes the Screenshot's folder on the local player's PC to be opened.

Security: RobloxScriptSecurity.

Protmethod void OpenVideosFolder()

Causes the Video's folder on the local player's PC to be opened.

Security: RobloxScriptSecurity.

Protmethod void ReportInGoogleAnalytics(string category, string action = custom, string label = none, int value = 0)

Security: RobloxScriptSecurity.

Pubmethod bool SavePlace(SaveFilter saveFilter = SaveAll)

Deprecated. Use SavePlaceAsync instead.

Tags: Yields, Deprecated.

Protmethod void SetPlaceId(int64 placeId)

Security: PluginSecurity.

Protmethod void SetUniverseId(int64 universeId)

Security: PluginSecurity.

Protmethod void Shutdown()

Security: LocalUserSecurity.

Events

Pubevent AllowedGearTypeChanged()

Tags: Deprecated.

Pubevent GraphicsQualityChangeRequest(bool betterQuality)

Pubevent ItemChanged(Instance object, string descriptor)

Tags: Deprecated.

Pubevent Loaded()

Fires when the game finishes loading. Use this to know when to remove your custom loading gui. It is best to check IsLoaded() before connecting to this event, as the game may load before the event is connected to.

Protevent ScreenshotReady(string path)

Security: RobloxScriptSecurity.

Callbacks

Callback icon Tuple OnClose()

Deprecated.

Tags: Deprecated.


External links

Community content is available under CC-BY-SA unless otherwise noted.