API:Class/RunService

Filtered-inheritance mode: While this class technically inherits all Instance class members, some (if not all) have been hidden because they serve no purpose for this object.
Service: This class is a service. It is a top-level singleton which can be obtained with the GetService method.

RunService.pngRunService : Object Icon.pngInstance

The RunService is responsible for all run-time activity and the progression of time in Roblox games.

Functions

FunctionsmemberhiddenFunctions [toggle]

voidBindToRenderStep ( string name, int priority, function(float deltaTime) function )

Binds the given function to the render step.

|RMD member="API:Class/RunService/BindToRenderStep"|Binds the given function to the render step.|/RMD|
boolIsClient ( )

Returns whether the script this method is invoked from runs on a client.

|RMD member="API:Class/RunService/IsClient"|Returns whether the script this method is invoked from runs on a client.|/RMD|
boolIsRunMode ( )

Returns whether the script this method is invoked from currently runs in studio after pressing Run.

|RMD member="API:Class/RunService/IsRunMode"|Returns whether the script this method is invoked from currently runs in studio after pressing Run.|/RMD|
boolIsRunning ( )

Returns true if the current game instance is running.

|RMD member="API:Class/RunService/IsRunning"|Returns true if the current game instance is running.|/RMD|
boolIsServer ( )

Returns whether the script this method is invoked from currently runs on a server.

|RMD member="API:Class/RunService/IsServer"|Returns whether the script this method is invoked from currently runs on a server.|/RMD|
boolIsStudio ( )

Returns whether the script this method is invoked from currently runs in studio.

|RMD member="API:Class/RunService/IsStudio"|Returns whether the script this method is invoked from currently runs in studio.|/RMD|
voidUnbindFromRenderStep ( string name )

Unbinds a function that was bound to the render loop using BindToRenderStep.

|RMD member="API:Class/RunService/UnbindFromRenderStep"|Unbinds a function that was bound to the render loop using BindToRenderStep.|/RMD|
voidPause ( ) [PluginSecurity]

Pauses the physics and scripts in a place.

|RMD member="API:Class/RunService/Pause"|Pauses the physics and scripts in a place.|/RMD|
voidReset ( ) [PluginSecurity] [deprecated]

Deprecated. Do not use.

|RMD member="API:Class/RunService/Reset"|Deprecated. Do not use.|/RMD|
voidRun ( ) [PluginSecurity]

Creates a waypoint and then runs the game just like the Play button does in studio.

|RMD member="API:Class/RunService/Run"|Creates a waypoint and then runs the game just like the Play button does in studio.|/RMD|
voidStop ( ) [PluginSecurity]

Stops the running simulation.

|RMD member="API:Class/RunService/Stop"|Stops the running simulation.|/RMD|
BindToRenderStep ( string name, int priority, function(float deltaTime) function )
Binds the given function to the render step.
Returns whether the script this method is invoked from runs on a client.
Returns whether the script this method is invoked from currently runs in studio after pressing Run.
Returns true if the current game instance is running.
Returns whether the script this method is invoked from currently runs on a server.
Returns whether the script this method is invoked from currently runs in studio.
Unbinds a function that was bound to the render loop using BindToRenderStep.
Pause ( ) [PluginSecurity]
Pauses the physics and scripts in a place.
Reset ( ) [PluginSecurity] [deprecated]
Deprecated. Do not use.
Run ( ) [PluginSecurity]
Creates a waypoint and then runs the game just like the Play button does in studio.
Stop ( ) [PluginSecurity]
Stops the running simulation.


Events

Events [toggle]

Heartbeat ( double step )

Fires every frame. The step argument indicates how much time has passed between frames. This is usually around 1/60th of a second. Please note that this will vary depending on the performance of the machine. If the game is only running at 40 FPS, that means that Heartbeat will fire 40 times per second, and the step argument will be roughly 1/40th of a second.

|RMD member="API:Class/RunService/Heartbeat"|Fires every frame. The step argument indicates how much time has passed between frames. This is usually around 1/60th of a second. Please note that this will vary depending on the performance of the machine. If the game is only running at 40 FPS, that means that Heartbeat will fire 40 times per second, and the step argument will be roughly 1/40th of a second.|/RMD|
RenderStepped ( double step )

Fires every render frame, which is approximately 1/60th of a second.

step is the amount of time that elapsed between the last render step and this render step.

|RMD member="API:Class/RunService/RenderStepped"|Fires every render frame, which is approximately 1/60th of a second.

step is the amount of time that elapsed between the last render step and this render step.|/RMD|

Stepped ( double time, double step )

Fired on every "step" in the RunService, a time of approximately 1/60th of a second.

|RMD member="API:Class/RunService/Stepped"|Fired on every "step" in the RunService, a time of approximately 1/60th of a second.|/RMD|
Heartbeat ( double step )
Fires every frame. The step argument indicates how much time has passed between frames. This is usually around 1/60th of a second. Please note that this will vary depending on the performance of the machine. If the game is only running at 40 FPS, that means that Heartbeat will fire 40 times per second, and the step argument will be roughly 1/40th of a second.
Fires every render frame, which is approximately 1/60th of a second. step is the amount of time that elapsed between the last render step and this render step.
Stepped ( double time, double step )
Fired on every "step" in the RunService, a time of approximately 1/60th of a second.

|RMD member="API:Class/RunService"|The RunService is responsible for all run-time activity and the progression of time in Roblox games. |/RMD|