Skip to main content
Version: latest - a1.73.x ⚖️

⌨️ Client

Static Class present on Client side.

🗿Static Class
This is a Static Class. Access it's methods directly with .. It's not possible to spawn new instances.
💂Authority
This static class can be accessed only on 🟧 Client side.
🧑‍💻API Source
This page is auto-generated! The Functions, Properties and Events described here are defined in our GitHub's API Repository! Feel free to commit suggestions and changes to the source .json API files!

🗿 Static Functions

ReturnsNameDescription
Copies a text to Clipboard
Disconnects from the server
of Gets a list of all values keys
Gets the current connected server IP:Port
Gets the current Frame Time
PlayerGets the local Player
Returns the current Map
Gets the Near Clip Plane value
of Returns a list of Packages running
Gets the Unix Epoch Time in milliseconds
Gets a value given a key
Returns if a Package is currently loaded
Enables/Disables Debug settings and Client Console to be used
Sets the Escape Menu text
Changes the Highlight Color for highlighted actors at a specific Index
Sets the Near Clip Plane
Changes the Outline Color for outlined actors at a specific Index
Sets a global value in the Client, which can be accessed from anywhere (client side)
Subscribes for an Event
Unsubscribes from all subscribed Events in this Class and in this Package, optionally passing the function to unsubscribe only that callback

CopyToClipboard

Copies a text to Clipboard

Client.CopyToClipboard(text)
TypeParameterDefaultDescription
text Required parameter No description provided

Disconnect

Disconnects from the server

Client.Disconnect()

GetAllValuesKeys

Gets a list of all values keys

— Returns of (a list with all values keys).

local ret = Client.GetAllValuesKeys()

See also GetValue, SetValue.


GetConnectedServerIP

Gets the current connected server IP:Port

— Returns .

local ret = Client.GetConnectedServerIP()

GetFrameTime

Gets the current Frame Time

— Returns (The Frame Time).

local ret = Client.GetFrameTime()

GetLocalPlayer

Gets the local Player

— Returns Player (The local Player).

local ret = Client.GetLocalPlayer()

GetMap

Returns the current Map

— Returns (The current Map).

local ret = Client.GetMap()

GetNearClipPlane

Gets the Near Clip Plane value

— Returns .

local ret = Client.GetNearClipPlane()

See also SetNearClipPlane.


GetPackages

Returns a list of Packages running

— Returns of (a list of Packages data ).

local ret = Client.GetPackages(package_type_filter?)
TypeParameterDefaultDescription
package_type_filter?-1Which Package type to return. Leave it default (-1) to return all types.

GetTime

Gets the Unix Epoch Time in milliseconds

— Returns (the unix timestamp).

local ret = Client.GetTime()

GetValue

Gets a value given a key

— Returns (Value at key or fallback if key doesn't exist).

local ret = Client.GetValue(key, fallback)
TypeParameterDefaultDescription
key Required parameter No description provided
fallback Required parameter No description provided

See also GetAllValuesKeys, SetValue.


IsPackageLoaded

Returns if a Package is currently loaded

— Returns (If the package is loaded).

local ret = Client.IsPackageLoaded(package_name)
TypeParameterDefaultDescription
package_name Required parameter No description provided

SetDebugEnabled

Enables/Disables Debug settings and Client Console to be used

Client.SetDebugEnabled(enable_debug)
TypeParameterDefaultDescription
enable_debug Required parameter No description provided

SetEscapeMenuText

Sets the Escape Menu text

Client.SetEscapeMenuText(text)
TypeParameterDefaultDescription
text Required parameter Supports using <h1>, <h2>, <h3> and <strong> tags in the text.
Client.SetEscapeMenuText Examples
Adding customized texts
Client.SetEscapeMenuText([[
<h1>Header 1</>
<h2>Header 2</>
<h3>Header 3</>
<strong>Strong</>
Normal Text
]])

SetHighlightColor

Changes the Highlight Color for highlighted actors at a specific Index. Multiply it by 5 (or more) for having a glowing effect.

HighlightMode.Always will always be visible, even behind walls
HighlightMode.OnlyHidden will only be visible if behind a wall
HighlightMode.OnlyVisible will only be visible if not behind a wall

Note: You can only have 3 differents indexes (0, 1 or 2).

Client.SetHighlightColor(highlight_color, index, mode?)
TypeParameterDefaultDescription
Colorhighlight_color Required parameter No description provided
index Required parameter No description provided
mode?HighlightMode.AlwaysNo description provided

SetNearClipPlane

Sets the Near Clip Plane

Client.SetNearClipPlane(near_clip_plane)
TypeParameterDefaultDescription
near_clip_plane Required parameter No description provided

See also GetNearClipPlane.


SetOutlineColor

Changes the Outline Color for outlined actors at a specific Index. Multiply it by 5 (or more) for having a glowing effect.

Note: You can only have 3 differents indexes (0, 1 or 2), and the default Outline color index used by the game is 0 (when interacting with stuff).

Client.SetOutlineColor(outline_color, index?, thickness?)
TypeParameterDefaultDescription
Coloroutline_color Required parameter No description provided
index?0No description provided
thickness?2No description provided

SetValue

Sets a global value in the Client, which can be accessed from anywhere (client side)

Please refer to Entity Values for more information

Client.SetValue(key, value)
TypeParameterDefaultDescription
key Required parameter No description provided
value Required parameter No description provided

See also GetAllValuesKeys, GetValue.


Subscribe

Subscribes for an Event

— Returns (the function callback itself).

local ret = Client.Subscribe(event_name, callback)
TypeParameterDefaultDescription
event_name Required parameter No description provided
callback Required parameter No description provided

Unsubscribe

Unsubscribes from all subscribed Events in this Class and in this Package, optionally passing the function to unsubscribe only that callback

Client.Unsubscribe(event_name, callback?)
TypeParameterDefaultDescription
event_name Required parameter No description provided
callback?nilNo description provided

🚀 Events

NameDescription
Called when the local player spawns (just after the game has loaded)
Called Every Frame. Do not abuse
Called when the game is focused/unfocused

SpawnLocalPlayer

Called when the local player spawns (just after the game has loaded)
Client.Subscribe("SpawnLocalPlayer", function(local_player)
-- SpawnLocalPlayer was called
end)
TypeArgumentDescription
Playerlocal_playerNo description provided

Tick

Called Every Frame. Do not abuse
Client.Subscribe("Tick", function(delta_time)
-- Tick was called
end)
TypeArgumentDescription
delta_timeNo description provided

WindowFocusChange

Called when the game is focused/unfocused
Client.Subscribe("WindowFocusChange", function(is_focused)
-- WindowFocusChange was called
end)
TypeArgumentDescription
is_focusedIf it's focused