evasivedocs
Roblox scriptingLuau 0.748 · 24 guides · 385 API entries
API reference

The game and its services

game, Workspace, players, characters, the camera and the services scripts use.

DataModel (game)

The game itself: the globals game and Game. Services resolve by class as well as by name, so game.Players works where a game renamed the service.

12 entries

DataModel.PlaceId

field

The place you are in, or 0 on the Roblox home screen.

Returns
  • number

DataModel.GameId

field

The experience (universe) the place belongs to.

Returns
  • number

DataModel.CreatorId

field

The user or group that owns the experience.

Returns
  • number

DataModel.JobId

field

The id of the server you are on.

Returns
  • string

DataModel.Workspace

field

The Workspace (also game.workspace and the global workspace).

Returns
  • Workspace

DataModel:GetService

method
DataModel:GetService(name) -> Instance

A service by class name: Players, Workspace, RunService, UserInputService, HttpService, Lighting, ...

Arguments
NameTypeDescription
namestring
Returns
  • Instance
Example
Luau
local Players = game:GetService("Players")

DataModel:FindService

method
DataModel:FindService(name) -> Instance?

A service by class name, or nil.

Arguments
NameTypeDescription
namestring
Returns
  • Instance?

DataModel:IsLoaded

method
DataModel:IsLoaded() -> boolean

true once the game has finished loading.

Returns
  • boolean
Example
Luau
repeat wait() until game:IsLoaded()

DataModel:HttpGet

method
DataModel:HttpGet(url [, headers]) -> string

The same as httpget.

Arguments
NameTypeDescription
urlstring
headersoptional{ [string]: string }
Returns
  • string
Example
Luau
local body = game:HttpGet("https://example.com")

DataModel:HttpGetAsync

method
DataModel:HttpGetAsync(url [, headers]) -> string

The same as HttpGet.

Arguments
NameTypeDescription
urlstring
headersoptional{ [string]: string }
Returns
  • string

DataModel:HttpPost

method
DataModel:HttpPost(url, body [, contentType] [, headers]) -> string

The same as httppost.

Arguments
NameTypeDefaultDescription
urlstring
bodystring
contentTypeoptionalstring"application/json"
headersoptional{ [string]: string }
Returns
  • string

DataModel:HttpPostAsync

method
DataModel:HttpPostAsync(url, body [, contentType] [, headers]) -> string

The same as HttpPost.

Arguments
NameTypeDescription
urlstring
bodystring
contentTypeoptionalstring
headersoptional{ [string]: string }
Returns
  • string

Workspace

The 3D world: game.Workspace, or the global workspace.

2 entries

Workspace.CurrentCamera

field

The camera you see through.

Returns
  • Camera

Workspace:Raycast

methodWorks differently
Workspace:Raycast(origin, direction [, params]) -> RaycastResult?

Casts a ray from origin along direction (its length is the range, at most 15000 studs) and returns the first hit, or nil. A zero direction gives nil.

Note

Rays hit what evasive's own map of the world holds: anchored parts (meshes by their collision shape), loose parts as boxes and every character's parts as boxes. They miss Terrain, parts with Transparency 0.5 or more, parts that do not collide, meshes and unions without a collision shape, and the camera's own parts. Right after a map change, the first casts can return nil for up to half a second.

Arguments
NameTypeDescription
originVector3
directionVector3
paramsoptionalRaycastParams
Returns
  • RaycastResult?
Example
Luau
local cam = workspace.CurrentCamera
local hit = workspace:Raycast(cam.CFrame.Position, cam.CFrame.LookVector * 500)
if hit then print(hit.Instance:GetFullName(), hit.Distance) end

Players

The Players service: game.Players or game:GetService("Players").

4 entries

Players.LocalPlayer

field

You.

Returns
  • Player

Players:GetPlayers

method
Players:GetPlayers() -> { Player }

Everyone in the server, you included.

Returns
  • { Player }
Example
Luau
for _, p in ipairs(Players:GetPlayers()) do print(p.Name) end

Players.PlayerAdded

signal
Players.PlayerAdded(player)

Fires when a player joins (checked ten times a second while connected).

Arguments
NameTypeDescription
playerPlayer
Returns
  • RBXScriptSignal
Example
Luau
Players.PlayerAdded:Connect(function(p) print(p.Name, "joined") end)

Players.PlayerRemoving

signal
Players.PlayerRemoving(player)

Fires when a player leaves.

Arguments
NameTypeDescription
playerPlayer
Returns
  • RBXScriptSignal

Player

A player in the server.

7 entries

Player.Character

field

The player's character model, or nil between lives.

Returns
  • Model?

Player.Team

field

The player's team, or nil.

Returns
  • Instance?

Player.UserId

field

The account's id.

Returns
  • number

Player.DisplayName

field

The display name (Name is the username).

Returns
  • string

Player:GetMouse

method
Player:GetMouse() -> Mouse

Your mouse. Only meaningful on LocalPlayer.

Returns
  • Mouse
Example
Luau
local mouse = Players.LocalPlayer:GetMouse()

Player.CharacterAdded

signal
Player.CharacterAdded(character)

Fires when the player gets a new character (a respawn). The character the player has when you first read the signal does not fire it.

Arguments
NameTypeDescription
characterModel
Returns
  • RBXScriptSignal
Example
Luau
Players.LocalPlayer.CharacterAdded:Connect(function(char)
    task.wait(1)
    print("respawned")
end)

Player.CharacterRemoving

signal
Player.CharacterRemoving(character)

Fires when the player's character goes, before CharacterAdded for the next one.

Arguments
NameTypeDescription
characterModel
Returns
  • RBXScriptSignal

Mouse

From Player:GetMouse().

2 entries

Mouse.X

field

The cursor's x in the Roblox window, in pixels.

Returns
  • number

Mouse.Y

field

The cursor's y in the Roblox window, in pixels.

Returns
  • number

Humanoid

The object that makes a character a character. All read-only.

5 entries

Humanoid.Health

field

Current health.

Returns
  • number

Humanoid.MaxHealth

field

Health when full.

Returns
  • number

Humanoid.WalkSpeed

field

Walking speed in studs per second.

Returns
  • number

Humanoid.JumpPower

field

Jump strength.

Returns
  • number

Humanoid.HipHeight

field

Height of the root part above the ground.

Returns
  • number

Camera

workspace.CurrentCamera.

8 entries

Camera.CFrame

field

Where the camera is and where it looks.

Returns
  • CFrame

Camera.Position

field

The camera's position.

Returns
  • Vector3

Camera.FieldOfView

field

The vertical field of view in degrees. Writable (1 to 120).

Returns
  • number
Example
Luau
workspace.CurrentCamera.FieldOfView = 90

Camera.ViewportSize

field

The Roblox window's size in pixels.

Returns
  • Vector2

Camera.CameraSubject

field

What the camera follows.

Returns
  • Instance?

Camera.lookAt

function
Camera.lookAt(at, target) -> CFrame

A CFrame at at, looking at target: the same as CFrame.lookAt. The camera does not move.

Arguments
NameTypeDescription
atVector3
targetVector3
Returns
  • CFrame
Example
Luau
local cf = Camera.lookAt(Vector3.new(0, 10, 0), Vector3.zero)

Camera:WorldToViewportPoint

method
Camera:WorldToViewportPoint(position) -> Vector3, boolean

Projects a world position: x and y in pixels, z the depth in studs, and whether it is on screen.

Arguments
NameTypeDescription
positionVector3
Returns
  • Vector3
  • boolean
Example
Luau
local p, visible = cam:WorldToViewportPoint(part.Position)

Camera:WorldToScreenPoint

method
Camera:WorldToScreenPoint(position) -> Vector3, boolean

Like WorldToViewportPoint.

Arguments
NameTypeDescription
positionVector3
Returns
  • Vector3
  • boolean

Lighting

The Lighting service. Read-only.

3 entries

Lighting.Ambient

field

The ambient light colour.

Returns
  • Color3

Lighting.ClockTime

field

Time of day in hours, 0 to 24.

Returns
  • number

Lighting.ExposureCompensation

field

Exposure adjustment.

Returns
  • number

UserInputService

Keyboard and mouse: game:GetService("UserInputService").

4 entries

UserInputService.InputBegan

signal
UserInputService.InputBegan(input, gameProcessed)

Fires when a key or mouse button goes down. gameProcessed is true when Roblox is not the window in front.

Arguments
NameTypeDescription
inputInputObjectKeyCode (an Enum.KeyCode item), Position (the mouse, as a Vector3 with z 0) and UserInputState ("Begin" or "End").
gameProcessedboolean
Returns
  • RBXScriptSignal
Example
Luau
UIS.InputBegan:Connect(function(input)
    if input.KeyCode == Enum.KeyCode.F then print("F") end
end)

UserInputService.InputEnded

signal
UserInputService.InputEnded(input, gameProcessed)

Fires when a key or mouse button is released.

Arguments
NameTypeDescription
inputInputObject
gameProcessedboolean
Returns
  • RBXScriptSignal

UserInputService:IsKeyDown

method
UserInputService:IsKeyDown(key) -> boolean

true while the key is held down.

Arguments
NameTypeDescription
keyEnumItem | number
Returns
  • boolean
Example
Luau
if UIS:IsKeyDown(Enum.KeyCode.LeftShift) then end

UserInputService:GetMouseLocation

method
UserInputService:GetMouseLocation() -> Vector2

The cursor in Roblox client pixels.

Returns
  • Vector2

RunService

Per-frame signals: game:GetService("RunService").

3 entries

RunService.RenderStepped

signal
RunService.RenderStepped(deltaTime)

Fires once per overlay frame. Good for moving drawings.

Arguments
NameTypeDescription
deltaTimenumber
Returns
  • RBXScriptSignal
Example
Luau
RunService.RenderStepped:Connect(function(dt) end)

RunService.Heartbeat

signal
RunService.Heartbeat(deltaTime)

Fires every scheduler tick, 240 times a second.

Arguments
NameTypeDescription
deltaTimenumber
Returns
  • RBXScriptSignal
Example
Luau
RunService.Heartbeat:Connect(function(dt) end)

RunService.Stepped

signalWorks differently
RunService.Stepped(deltaTime)

Fires every scheduler tick, like Heartbeat.

Note

Handlers get one argument, deltaTime. Roblox passes time and deltaTime.

Arguments
NameTypeDescription
deltaTimenumber
Returns
  • RBXScriptSignal

HttpService

game:GetService("HttpService").

3 entries

HttpService:JSONEncode

method
HttpService:JSONEncode(value) -> string

Encodes a table (or another value) as JSON.

Arguments
NameTypeDescription
valueany
Returns
  • string
Example
Luau
local json = Http:JSONEncode({ a = 1 })

HttpService:JSONDecode

method
HttpService:JSONDecode(json) -> any

Decodes JSON into Luau values.

Arguments
NameTypeDescription
jsonstring
Returns
  • any
Example
Luau
local t = Http:JSONDecode('{"a":1}')

HttpService:GenerateGUID

method
HttpService:GenerateGUID() -> string

A new random GUID.

Returns
  • string

RemoteEvent

Messages to the game's server.

1 entry

RemoteEvent:FireServer

methodNot available
RemoteEvent:FireServer(...)

Would send a message to the server.

Warning

Needs code running inside the Roblox client. evasive reads and writes the game's memory from outside, so this call checks its arguments and then raises. cancallserver() is always false.

Arguments
NameTypeDescription
...any

RemoteFunction

Calls to the game's server.

2 entries

RemoteFunction:InvokeServer

methodNot available
RemoteFunction:InvokeServer(...) -> ...any

Would call the server and wait for its answer.

Warning

Needs code running inside the Roblox client. evasive reads and writes the game's memory from outside, so this call checks its arguments and then raises. cancallserver() is always false.

Arguments
NameTypeDescription
...any
Returns
  • ...any

RemoteFunction:InvokeFunction

methodNot available
RemoteFunction:InvokeFunction(...) -> ...any

Another name for InvokeServer.

Warning

Needs code running inside the Roblox client. evasive reads and writes the game's memory from outside, so this call checks its arguments and then raises. cancallserver() is always false.

Arguments
NameTypeDescription
...any
Returns
  • ...any