Skip to content

Game

Not newable

This object cannot be created by scripts using Instance.New()

This object can be accessed in scripts by using the game keyword.

Game is the root object in the Polytoria instance tree. It is the object of which everything is descended.

Inherits Instance

Events

Rendered

Called every frame after the place has been rendered

Notice

The server is incapable of rendering frames; rather, on server Scripts, the event will fire at the server's tick rate which may vary between 1-30Hz.

It is recommended to only listen to this event on LocalScripts.

Properties

GameID : number

The ID of the current Polytoria place.

Example

print(game.GameID)

The value is 0 when testing locally through Polytoria Creator, which can be used as a conditional to check if the place is live or not.

InstanceCount : number

The total number of instances currently loaded

Example

print(game.InstanceCount)

Remarks

The value will differ depending on if it is being accessed through a Script or a LocalScript, as LocalScripts can only see instances that are relevant to the client.

LocalInstanceCount : number

The amount of instances currently loaded on the client.

Example

print(game.LocalInstanceCount)

PlayersConnected : number

Returns the amount of players connected to the game.

Example

print(game.PlayersConnected)

This property is read-only and cannot be modified.