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.
Static Functions​
Returns | Name | Description | |
---|---|---|---|
CopyToClipboard | Copies a text to Clipboard | ||
SetNearClipPlane | Sets the Near Clip Plane | ||
float | GetNearClipPlane | Gets the Near Clip Plane value | |
string | GetConnectedServerIP | Gets the current connected server IP:Port | |
SetDebugEnabled | Enables/Disables Debug settings and Client Console to be used | ||
SetHighlightColor | Changes the Highlight Color for highlighted actors at a specific Index | ||
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 | ||
Player | GetLocalPlayer | Gets the local Player | |
float | GetFrameTime | Gets the current Frame Time | |
integer | GetTime | Gets the Unix Epoch Time in milliseconds | |
string | GetMap | Returns the current Map | |
table of string | GetPackages | Returns a list of Packages folder names loaded and running in the client | |
any or nil | GetValue | Gets a value given a key |
CopyToClipboard
​
Copies a text to Clipboard
Client.CopyToClipboard(text)
Type | Parameter | Default | Description |
---|---|---|---|
string | text |
SetNearClipPlane
​
Sets the Near Clip Plane
Client.SetNearClipPlane(near_clip_plane)
Type | Parameter | Default | Description |
---|---|---|---|
float | near_clip_plane |
GetNearClipPlane
​
Gets the Near Clip Plane value
— Returns float.
local ret = Client.GetNearClipPlane()
GetConnectedServerIP
​
Gets the current connected server IP:Port
— Returns string.
local ret = Client.GetConnectedServerIP()
SetDebugEnabled
​
Enables/Disables Debug settings and Client Console to be used
Client.SetDebugEnabled(enable_debug)
Type | Parameter | Default | Description |
---|---|---|---|
boolean | enable_debug |
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 | ||
integer | index | ||
HighlightMode | mode? | HighlightMode.Always |
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?)
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)
Subscribe
​
Subscribes for an Event
— Returns function (the function callback itself).
local ret = Client.Subscribe(event_name, callback)
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?)
GetLocalPlayer
​
Gets the local Player
— Returns Player (The local Player).
local ret = Client.GetLocalPlayer()
GetFrameTime
​
Gets the current Frame Time
— Returns float (The Frame Time).
local ret = Client.GetFrameTime()
GetTime
​
Gets the Unix Epoch Time in milliseconds
— Returns integer (the unix timestamp).
local ret = Client.GetTime()
GetMap
​
Returns the current Map
— Returns string (The current Map).
local ret = Client.GetMap()
GetPackages
​
Returns a list of Packages folder names loaded and running in the client
— Returns table of string (packages folder names).
local ret = Client.GetPackages()
GetValue
​
Gets a value given a key
— Returns any or nil (the value).
local ret = Client.GetValue(key, fallback)
Events​
Name | Description | |
---|---|---|
Tick | Called Every Frame. Do not abuse | |
AttemptOpenInGameMenu | Called when the client attempts to open Escape Menu | |
SpawnLocalPlayer | Called when the local player spawns (just after the game has loaded) | |
WindowFocusChange | Called when the game is focused/unfocused |
Tick
​
Called Every Frame. Do not abuse
Client.Subscribe("Tick", function(delta_time)
-- Tick was called
end)
Type | Argument | Description |
---|---|---|
float | delta_time |
AttemptOpenInGameMenu
​
Called when the client attempts to open Escape Menu
Returnfalse
to prevent it
Client.Subscribe("AttemptOpenInGameMenu", function()
-- AttemptOpenInGameMenu was called
end)
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 |
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 |