Skip to main content
Version: bleeding-edge ๐Ÿฉธ

โŒจ๏ธ 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
The methods, properties and events descriptions from this page are defined in our GitHub API Repository!

๐Ÿ—ฟย Static Functionsโ€‹

ReturnsNameDescription
CopyToClipboardCopies a text to Clipboard
DisconnectDisconnects from the server
table of stringGetAllValuesKeysGets a list of all values keys
stringGetConnectedServerIPGets the current connected server IP:Port
floatGetFrameTimeGets the current Frame Time
PlayerGetLocalPlayerGets the local Player
stringGetMapReturns the current Map
floatGetNearClipPlaneGets the Near Clip Plane value
table of tableGetPackagesReturns a list of Packages running
integerGetTimeGets the Unix Epoch Time in milliseconds
anyGetValueGets a value given a key
SetDebugEnabledEnables/Disables Debug settings and Client Console to be used
SetEscapeMenuTextSets the Escape Menu text
SetHighlightColorChanges the Highlight Color for highlighted actors at a specific Index
SetNearClipPlaneSets the Near Clip Plane
SetOutlineColorChanges the Outline Color for outlined actors at a specific Index
SetValueSets a global value in the Client, which can be accessed from anywhere (client side)
functionSubscribeSubscribes for an Event
UnsubscribeUnsubscribes 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
stringtext

Disconnect

Disconnects from the server

Client.Disconnect()

GetAllValuesKeys

Gets a list of all values keys

โ€” Returns table of string (a list with all values keys).

local ret = Client.GetAllValuesKeys()

See also GetValue, SetValue.


GetConnectedServerIP

Gets the current connected server IP:Port

โ€” Returns string.

local ret = Client.GetConnectedServerIP()

GetFrameTime

Gets the current Frame Time

โ€” Returns float (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 string (The current Map).

local ret = Client.GetMap()

GetNearClipPlane

Gets the Near Clip Plane value

โ€” Returns float.

local ret = Client.GetNearClipPlane()

See also SetNearClipPlane.


GetPackages

Returns a list of Packages running

โ€” Returns table of table (a list of Packages data with this format).

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

GetTime

Gets the Unix Epoch Time in milliseconds

โ€” Returns integer (the unix timestamp).

local ret = Client.GetTime()

GetValue

Gets a value given a key

โ€” Returns any (Value at key or fallback if key doesn't exist).

local ret = Client.GetValue(key, fallback)
TypeParameterDefaultDescription
stringkey
anyfallback

See also GetAllValuesKeys, SetValue.


SetDebugEnabled

Enables/Disables Debug settings and Client Console to be used

Client.SetDebugEnabled(enable_debug)
TypeParameterDefaultDescription
booleanenable_debug

SetEscapeMenuText

Sets the Escape Menu text

Client.SetEscapeMenuText(text)
TypeParameterDefaultDescription
stringtextSupports 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
integerindex
HighlightModemode?HighlightMode.Always

SetNearClipPlane

Sets the Near Clip Plane

Client.SetNearClipPlane(near_clip_plane)
TypeParameterDefaultDescription
floatnear_clip_plane

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
integerindex?0
floatthickness?2

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
stringkey
anyvalue

See also GetAllValuesKeys, GetValue.


Subscribe

Subscribes for an Event

โ€” Returns function (the function callback itself).

local ret = Client.Subscribe(event_name, callback)
TypeParameterDefaultDescription
stringevent_name
functioncallback

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
stringevent_name
functioncallback?nil

๐Ÿš€ย Eventsโ€‹

NameDescription
SpawnLocalPlayerCalled when the local player spawns (just after the game has loaded)
TickCalled Every Frame. Do not abuse
WindowFocusChangeCalled 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_player

Tick

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

WindowFocusChange

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