โจ๏ธ 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โ
Returns | Name | Description | |
---|---|---|---|
CopyToClipboard | Copies a text to Clipboard | ||
Disconnect | Disconnects from the server | ||
table of string | GetAllValuesKeys | Gets a list of all values keys | |
string | GetConnectedServerIP | Gets the current connected server IP:Port | |
float | GetFrameTime | Gets the current Frame Time | |
Player | GetLocalPlayer | Gets the local Player | |
string | GetMap | Returns the current Map | |
float | GetNearClipPlane | Gets the Near Clip Plane value | |
table of table | GetPackages | Returns a list of Packages running | |
integer | GetTime | Gets the Unix Epoch Time in milliseconds | |
any | GetValue | Gets a value given a key | |
SetDebugEnabled | Enables/Disables Debug settings and Client Console to be used | ||
SetEscapeMenuText | Sets the Escape Menu text | ||
SetHighlightColor | Changes the Highlight Color for highlighted actors at a specific Index | ||
SetNearClipPlane | Sets the Near Clip Plane | ||
SetOutlineColor | Changes the Outline Color for outlined actors at a specific Index | ||
SetValue | Sets a global value in the Client, which can be accessed from anywhere (client side) | ||
function | Subscribe | Subscribes for an Event | |
Unsubscribe | 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)
Type | Parameter | Default | Description |
---|---|---|---|
string | text | Required parameter | No description provided |
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()
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?)
Type | Parameter | Default | Description |
---|---|---|---|
PackageType | package_type_filter? | -1 | Which 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)
Type | Parameter | Default | Description |
---|---|---|---|
string | key | Required parameter | No description provided |
any | fallback | Required parameter | No description provided |
See also GetAllValuesKeys, SetValue.
SetDebugEnabled
Enables/Disables Debug settings and Client Console to be used
Client.SetDebugEnabled(enable_debug)
Type | Parameter | Default | Description |
---|---|---|---|
boolean | enable_debug | Required parameter | No description provided |
SetEscapeMenuText
Sets the Escape Menu text
Client.SetEscapeMenuText(text)
Type | Parameter | Default | Description |
---|---|---|---|
string | 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 wallsHighlightMode.OnlyHidden
will only be visible if behind a wallHighlightMode.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?)
Type | Parameter | Default | Description |
---|---|---|---|
Color | highlight_color | Required parameter | No description provided |
integer | index | Required parameter | No description provided |
HighlightMode | mode? | HighlightMode.Always | No description provided |
SetNearClipPlane
Sets the Near Clip Plane
Client.SetNearClipPlane(near_clip_plane)
Type | Parameter | Default | Description |
---|---|---|---|
float | 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 is0
(when interacting with stuff).
Client.SetOutlineColor(outline_color, index?, thickness?)
Type | Parameter | Default | Description |
---|---|---|---|
Color | outline_color | Required parameter | No description provided |
integer | index? | 0 | No description provided |
float | thickness? | 2 | No 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)
Type | Parameter | Default | Description |
---|---|---|---|
string | key | Required parameter | No description provided |
any | value | Required parameter | No description provided |
See also GetAllValuesKeys, GetValue.
Subscribe
Subscribes for an Event
โ Returns function (the function callback itself).
local ret = Client.Subscribe(event_name, callback)
Type | Parameter | Default | Description |
---|---|---|---|
string | event_name | Required parameter | No description provided |
function | 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?)
Type | Parameter | Default | Description |
---|---|---|---|
string | event_name | Required parameter | No description provided |
function | callback? | nil | No description provided |
๐ย Eventsโ
Name | Description | |
---|---|---|
SpawnLocalPlayer | Called when the local player spawns (just after the game has loaded) | |
Tick | Called Every Frame. Do not abuse | |
WindowFocusChange | 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)
Type | Argument | Description |
---|---|---|
Player | local_player | No description provided |
Tick
Called Every Frame. Do not abuse
Client.Subscribe("Tick", function(delta_time)
-- Tick was called
end)
Type | Argument | Description |
---|---|---|
float | delta_time | No description provided |
WindowFocusChange
Called when the game is focused/unfocused
Client.Subscribe("WindowFocusChange", function(is_focused)
-- WindowFocusChange was called
end)
Type | Argument | Description |
---|---|---|
boolean | is_focused | If it's focused |