Passer au contenu principal
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
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
CopyToClipboardCopies a text to Clipboard
DisconnectDisconnects from the server
table of Base ActorGetActorsInRadiusReturns the actors within the specified radius
table of stringGetAllValuesKeysGets a list of all values keys
stringGetConnectedServerIPGets the current connected server IP:Port
Base Entity or nilGetEntityByIDReturns the entity with the specified ID
floatGetFrameTimeGets the current Frame Time
stringGetLanguageGets the current language of the Client
PlayerGetLocalPlayerGets the local Player
integerGetLogLevelReturns the current log level
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
booleanIsPackageLoadedReturns if a Package is currently loaded
OpenEscapeMenuOpens the escape menu
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
SetSettingGammaOverrideOverrides the gamma setting and prevents the client from changing it
SetValueSets a global value in the Client, which can be accessed from anywhere (client side)
ShowNotificationShows a notification using the built-in notification system.
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)

Parameters

TypeParameterDefaultDescription
stringtext Required parameter No description provided

Disconnect

Disconnects from the server
Client.Disconnect()

GetActorsInRadius

Returns the actors within the specified radius
local ret = Client.GetActorsInRadius(location, radius, only_classes?)

Parameters

TypeParameterDefaultDescription
Vectorlocation Required parameter The center location of the search
numberradius Required parameter The search radius
table of stringonly_classes?[]Only actors of these classes will be returned (pass empty for all classes)

Returns

TypeDescription
table of Base ActorThe actors found in radius

GetAllValuesKeys

Gets a list of all values keys
local ret = Client.GetAllValuesKeys()

Returns

TypeDescription
table of stringa list with all values keys

See also GetValue, SetValue.


GetConnectedServerIP

Gets the current connected server IP:Port
local ret = Client.GetConnectedServerIP()

Returns

TypeDescription
stringNo description provided

GetEntityByID

Returns the entity with the specified ID
local ret = Client.GetEntityByID(entity_id)

Parameters

TypeParameterDefaultDescription
integerentity_id Required parameter No description provided

Returns

TypeDescription
Base Entity or nilthe entity

GetFrameTime

Gets the current Frame Time
local ret = Client.GetFrameTime()

Returns

TypeDescription
floatthe Frame Time

GetLanguage

Gets the current language of the Client
local ret = Client.GetLanguage()

Returns

TypeDescription
stringthe language code

GetLocalPlayer

Gets the local Player
local ret = Client.GetLocalPlayer()

Returns

TypeDescription
Playerthe local Player

GetLogLevel

Returns the current log level
local ret = Client.GetLogLevel()

Returns

TypeDescription
integerthe log level

GetMap

Returns the current Map
local ret = Client.GetMap()

Returns

TypeDescription
stringthe current Map

GetNearClipPlane

Gets the Near Clip Plane value
local ret = Client.GetNearClipPlane()

Returns

TypeDescription
floatNo description provided

See also SetNearClipPlane.


GetPackages

Returns a list of Packages running
local ret = Client.GetPackages(package_type_filter?)

Parameters

TypeParameterDefaultDescription
PackageTypepackage_type_filter?PackageType.AllWhich Package type to return. Leave it default to return all types.

Returns

TypeDescription
table of tablea list of Packages data with this format

GetTime

Gets the Unix Epoch Time in milliseconds
local ret = Client.GetTime()

Returns

TypeDescription
integerthe unix timestamp

GetValue

Gets a value given a key
local ret = Client.GetValue(key, fallback)

Parameters

TypeParameterDefaultDescription
stringkey Required parameter No description provided
anyfallback Required parameter No description provided

Returns

TypeDescription
anyValue at key or fallback if key doesn't exist

See also GetAllValuesKeys, SetValue.


IsPackageLoaded

Returns if a Package is currently loaded
local ret = Client.IsPackageLoaded(package_name)

Parameters

TypeParameterDefaultDescription
stringpackage_name Required parameter No description provided

Returns

TypeDescription
booleanif the package is loaded

OpenEscapeMenu

Opens the escape menu
Client.OpenEscapeMenu(open_settings?)

Parameters

TypeParameterDefaultDescription
booleanopen_settings?falseIf true, opens the Settings tab directly

SetDebugEnabled

Enables/Disables Debug settings and Client Console to be used
Client.SetDebugEnabled(enable_debug)

Parameters

TypeParameterDefaultDescription
booleanenable_debug Required parameter No description provided

SetEscapeMenuText

Sets the Escape Menu text
Client.SetEscapeMenuText(text)

Parameters

TypeParameterDefaultDescription
stringtext 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 different indexes (0, 1 or 2).
Client.SetHighlightColor(highlight_color, index, mode?)

Parameters

TypeParameterDefaultDescription
Colorhighlight_color Required parameter No description provided
integerindex Required parameter No description provided
HighlightModemode?HighlightMode.AlwaysNo description provided

SetNearClipPlane

Sets the Near Clip Plane
Client.SetNearClipPlane(near_clip_plane)

Parameters

TypeParameterDefaultDescription
floatnear_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 different 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?)

Parameters

TypeParameterDefaultDescription
Coloroutline_color Required parameter No description provided
integerindex?0No description provided
floatthickness?2No description provided

SetSettingGammaOverride

Overrides the gamma setting and prevents the client from changing it
Client.SetSettingGammaOverride(override, new_gamma?)

Parameters

TypeParameterDefaultDescription
booleanoverride Required parameter Whether to override the gamma setting
float or nilnew_gamma?1.0The new gamma value if overriding

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)

Parameters

TypeParameterDefaultDescription
stringkey Required parameter Key
anyvalue Required parameter Valeur

See also GetAllValuesKeys, GetValue, ValueChange.


ShowNotification

Shows a notification using the built-in notification system.
Client.ShowNotification(text, notification_type?, add_to_notification_list?, duration?)

Parameters

TypeParameterDefaultDescription
stringtext Required parameter No description provided
NotificationTypenotification_type?NotificationType.InfoNo description provided
booleanadd_to_notification_list?trueWhether to add this notification to the notification list (accessible from the bell icon on the top-right corner)
floatduration?10Duration in seconds to display the notification

Subscribe

Subscribes for an Event
local ret = Client.Subscribe(event_name, callback)

Parameters

TypeParameterDefaultDescription
stringevent_name Required parameter No description provided
functioncallback Required parameter No description provided

Returns

TypeDescription
functionthe function callback itself

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?)

Parameters

TypeParameterDefaultDescription
stringevent_name Required parameter No description provided
functioncallback?nilNo description provided

🚀 Events

NameDescription
LanguageChangeCalled when the Client language changes
SpawnLocalPlayerCalled when the local player spawns (just after the game has loaded)
TickCalled Every Frame. Do not abuse
ValueChangeTriggered when a Value is changed with Client.SetValue() or Server.SetValue() (for synced values)
WindowFocusChangeCalled when the game is focused/unfocused

LanguageChange

Called when the Client language changes
Client.Subscribe("LanguageChange", function(language)
-- LanguageChange was called
end)

Arguments

TypeArgumentDescription
stringlanguageThe new language code

SpawnLocalPlayer

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

Arguments

TypeArgumentDescription
Playerlocal_playerNo description provided

Tick

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

Arguments

TypeArgumentDescription
floatdelta_timeNo description provided

ValueChange

Triggered when a Value is changed with Client.SetValue() or Server.SetValue() (for synced values)
Client.Subscribe("ValueChange", function(key, value)
-- ValueChange was called
end)

Arguments

TypeArgumentDescription
stringkeyThe key that changed
anyvalueThe new value

See also SetValue, Server.SetValue().


WindowFocusChange

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

Arguments

TypeArgumentDescription
booleanis_focusedIf it's focused