Skip to main content

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​

ReturnsNameDescription
CopyToClipboardCopies a text to Clipboard
SetNearClipPlaneSets the Near Clip Plane
floatGetNearClipPlaneGets the Near Clip Plane value
stringGetConnectedServerIPGets the current connected server IP:Port
SetDebugEnabledEnables/Disables Debug settings and Client Console to be used
SetHighlightColorChanges the Highlight Color for highlighted actors at a specific Index
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
PlayerGetLocalPlayerGets the local Player
floatGetFrameTimeGets the current Frame Time
integerGetTimeGets the Unix Epoch Time in milliseconds
stringGetMapReturns the current Map
table of stringGetPackagesReturns a list of Packages folder names loaded and running in the client
any or nilGetValueGets a value given a key

CopyToClipboard​

Copies a text to Clipboard

Client.CopyToClipboard(text)
TypeParameterDefaultDescription
stringtext

SetNearClipPlane​

Sets the Near Clip Plane

Client.SetNearClipPlane(near_clip_plane)
TypeParameterDefaultDescription
floatnear_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)
TypeParameterDefaultDescription
booleanenable_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 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

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

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

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)
TypeParameterDefaultDescription
stringkey
anyfallback

Events​

NameDescription
TickCalled Every Frame. Do not abuse
AttemptOpenInGameMenuCalled when the client attempts to open Escape Menu
SpawnLocalPlayerCalled when the local player spawns (just after the game has loaded)
WindowFocusChangeCalled when the game is focused/unfocused

Tick​

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

AttemptOpenInGameMenu​

Called when the client attempts to open Escape Menu

Return false 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)
TypeArgumentDescription
Playerlocal_player

WindowFocusChange​

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