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 from which everything is descended.
Inherits Instance
Events¶
Rendered¶
Parameters: deltaTime [ float
]
Fires every frame after the place has been rendered. The deltaTime
parameter is the time between the last frame and the current.
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 : int
¶
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 : int
¶
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 : int
¶
The number of instances currently loaded on the client.
Example
print(game.LocalInstanceCount)
PlayersConnected : int
¶
Returns the number of players connected to the game.
Example
print(game.PlayersConnected)
This property is read-only and cannot be modified.