Collapse Sidebar


This function returns whether the ‘Run’ button has been pressed to run the simulation in Roblox Studio.

If the user has pressed ‘Run’, then this function will return true. This function will continue to return true if the simulation has been paused using the ‘Pause’ button. However, once it has been stopped using the ‘Stop’ button it will revert to returning false.

Roblox Studio only enters run mode when the ‘Run’ button is pressed, not the ‘Play’ button. This function will also return false if the simulation was started using RunService/Run rather than the ‘Run’ button.

RunService test function results

See also

  • RunService/IsClient
  • RunService/IsServer
  • RunService/IsStudio
  • RunService/IsRunning
  • RunService/IsEdit


Return Type Summary

Whether the ‘Run’ button has been pressed to run the simulation in Roblox Studio

Code Samples

Run Context

This code prints out details of a script’s running context, like if it is running on the server, client, in studio, etc. It uses RunService to do this.

Try pasting this code into a Script or LocalScript. See how it runs in online mode and on a Roblox server (open the developer console).

local RunService = game:GetService("RunService")

if RunService:IsStudio() then
	print("I am in Roblox Studio")
	print("I am in an online Roblox Server")

if RunService:IsRunMode() then
	print("Running in Studio")

if RunService:IsClient() then
	print("I am a client")
	print("I am not a client")

if RunService:IsServer() then
	print("I am a server")
	print("I am not a server")

if RunService:IsRunning() then
	print("The game is running")
	print("The game is stopped or paused")