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.
The place you are in, or 0 on the Roblox home screen.
number
The experience (universe) the place belongs to.
number
The user or group that owns the experience.
number
The id of the server you are on.
string
The Workspace (also game.workspace and the global workspace).
Workspace
DataModel:GetService(name) -> InstanceA service by class name: Players, Workspace, RunService, UserInputService, HttpService, Lighting, ...
| Name | Type | Description |
|---|---|---|
name | string |
Instance
local Players = game:GetService("Players")DataModel:FindService(name) -> Instance?A service by class name, or nil.
| Name | Type | Description |
|---|---|---|
name | string |
Instance?
DataModel:IsLoaded() -> booleantrue once the game has finished loading.
boolean
repeat wait() until game:IsLoaded()DataModel:HttpGet(url [, headers]) -> stringThe same as httpget.
| Name | Type | Description |
|---|---|---|
url | string | |
headersoptional | { [string]: string } |
string
local body = game:HttpGet("https://example.com")DataModel:HttpGetAsync(url [, headers]) -> stringThe same as HttpGet.
| Name | Type | Description |
|---|---|---|
url | string | |
headersoptional | { [string]: string } |
string
DataModel:HttpPost(url, body [, contentType] [, headers]) -> stringThe same as httppost.
| Name | Type | Default | Description |
|---|---|---|---|
url | string | ||
body | string | ||
contentTypeoptional | string | "application/json" | |
headersoptional | { [string]: string } |
string
DataModel:HttpPostAsync(url, body [, contentType] [, headers]) -> stringThe same as HttpPost.
| Name | Type | Description |
|---|---|---|
url | string | |
body | string | |
contentTypeoptional | string | |
headersoptional | { [string]: string } |
string
The camera you see through.
Camera
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.
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.
| Name | Type | Description |
|---|---|---|
origin | Vector3 | |
direction | Vector3 | |
paramsoptional | RaycastParams |
RaycastResult?
local cam = workspace.CurrentCamera
local hit = workspace:Raycast(cam.CFrame.Position, cam.CFrame.LookVector * 500)
if hit then print(hit.Instance:GetFullName(), hit.Distance) endYou.
Player
Players:GetPlayers() -> { Player }Everyone in the server, you included.
{ Player }
for _, p in ipairs(Players:GetPlayers()) do print(p.Name) endPlayers.PlayerAdded(player)Fires when a player joins (checked ten times a second while connected).
| Name | Type | Description |
|---|---|---|
player | Player |
RBXScriptSignal
Players.PlayerAdded:Connect(function(p) print(p.Name, "joined") end)Players.PlayerRemoving(player)Fires when a player leaves.
| Name | Type | Description |
|---|---|---|
player | Player |
RBXScriptSignal
The player's character model, or nil between lives.
Model?
The player's team, or nil.
Instance?
The account's id.
number
The display name (Name is the username).
string
Player:GetMouse() -> MouseYour mouse. Only meaningful on LocalPlayer.
Mouse
local mouse = Players.LocalPlayer:GetMouse()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.
| Name | Type | Description |
|---|---|---|
character | Model |
RBXScriptSignal
Players.LocalPlayer.CharacterAdded:Connect(function(char)
task.wait(1)
print("respawned")
end)Player.CharacterRemoving(character)Fires when the player's character goes, before CharacterAdded for the next one.
| Name | Type | Description |
|---|---|---|
character | Model |
RBXScriptSignal
The cursor's x in the Roblox window, in pixels.
number
The cursor's y in the Roblox window, in pixels.
number
Current health.
number
Health when full.
number
Walking speed in studs per second.
number
Jump strength.
number
Height of the root part above the ground.
number
Where the camera is and where it looks.
CFrame
The camera's position.
Vector3
The vertical field of view in degrees. Writable (1 to 120).
number
workspace.CurrentCamera.FieldOfView = 90The Roblox window's size in pixels.
Vector2
What the camera follows.
Instance?
Camera.lookAt(at, target) -> CFrameA CFrame at at, looking at target: the same as CFrame.lookAt. The camera does not move.
| Name | Type | Description |
|---|---|---|
at | Vector3 | |
target | Vector3 |
CFrame
local cf = Camera.lookAt(Vector3.new(0, 10, 0), Vector3.zero)Camera:WorldToViewportPoint(position) -> Vector3, booleanProjects a world position: x and y in pixels, z the depth in studs, and whether it is on screen.
| Name | Type | Description |
|---|---|---|
position | Vector3 |
Vector3boolean
local p, visible = cam:WorldToViewportPoint(part.Position)Camera:WorldToScreenPoint(position) -> Vector3, booleanLike WorldToViewportPoint.
| Name | Type | Description |
|---|---|---|
position | Vector3 |
Vector3boolean
The ambient light colour.
Color3
Time of day in hours, 0 to 24.
number
Exposure adjustment.
number
UserInputService.InputBegan(input, gameProcessed)Fires when a key or mouse button goes down. gameProcessed is true when Roblox is not the window in front.
| Name | Type | Description |
|---|---|---|
input | InputObject | KeyCode (an Enum.KeyCode item), Position (the mouse, as a Vector3 with z 0) and UserInputState ("Begin" or "End"). |
gameProcessed | boolean |
RBXScriptSignal
UIS.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.F then print("F") end
end)UserInputService.InputEnded(input, gameProcessed)Fires when a key or mouse button is released.
| Name | Type | Description |
|---|---|---|
input | InputObject | |
gameProcessed | boolean |
RBXScriptSignal
UserInputService:IsKeyDown(key) -> booleantrue while the key is held down.
| Name | Type | Description |
|---|---|---|
key | EnumItem | number |
boolean
if UIS:IsKeyDown(Enum.KeyCode.LeftShift) then endUserInputService:GetMouseLocation() -> Vector2The cursor in Roblox client pixels.
Vector2
RunService.RenderStepped(deltaTime)Fires once per overlay frame. Good for moving drawings.
| Name | Type | Description |
|---|---|---|
deltaTime | number |
RBXScriptSignal
RunService.RenderStepped:Connect(function(dt) end)RunService.Heartbeat(deltaTime)Fires every scheduler tick, 240 times a second.
| Name | Type | Description |
|---|---|---|
deltaTime | number |
RBXScriptSignal
RunService.Heartbeat:Connect(function(dt) end)RunService.Stepped(deltaTime)Fires every scheduler tick, like Heartbeat.
Handlers get one argument, deltaTime. Roblox passes time and deltaTime.
| Name | Type | Description |
|---|---|---|
deltaTime | number |
RBXScriptSignal
HttpService:JSONEncode(value) -> stringEncodes a table (or another value) as JSON.
| Name | Type | Description |
|---|---|---|
value | any |
string
local json = Http:JSONEncode({ a = 1 })HttpService:JSONDecode(json) -> anyDecodes JSON into Luau values.
| Name | Type | Description |
|---|---|---|
json | string |
any
local t = Http:JSONDecode('{"a":1}')HttpService:GenerateGUID() -> stringA new random GUID.
string
RemoteEvent:FireServer(...)Would send a message to the server.
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.
| Name | Type | Description |
|---|---|---|
... | any |
RemoteFunction:InvokeServer(...) -> ...anyWould call the server and wait for its answer.
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.
| Name | Type | Description |
|---|---|---|
... | any |
...any
RemoteFunction:InvokeFunction(...) -> ...anyAnother name for InvokeServer.
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.
| Name | Type | Description |
|---|---|---|
... | any |
...any