Ir para o conteúdo principal
Version: latest - a1.156.0 ⚖️

⌨️ Client

Static Class present on Client side.

🗿Static ClassClient Only🧑‍💻API Source

🗿 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 package name
floatGetNearClipPlaneGets the Near Clip Plane value
table of tableGetPackagesReturns a list of Packages running
tableGetSettingsGets the local player's game Settings
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

Optimal

CopyToClipboard​

Copies a text to Clipboard
Client.CopyToClipboard(text)

Parameters

TypeParameterDefaultDescription
stringtext Required parameter The text to copy

Slow

Disconnect​

Disconnects from the server
Client.Disconnect()

Moderate

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

Moderate

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.


Optimal

GetConnectedServerIP​

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

Returns

TypeDescription
stringCurrent connected server IP:Port

Moderate

GetEntityByID​

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

Parameters

TypeParameterDefaultDescription
integerentity_id Required parameter The entity ID

Returns

TypeDescription
Base Entity or nilthe entity

Optimal

GetFrameTime​

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

Returns

TypeDescription
floatthe Frame Time

Optimal

GetLanguage​

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

Returns

TypeDescription
stringthe language code

Optimal

GetLocalPlayer​

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

Returns

TypeDescription
Playerthe local Player

Optimal

GetLogLevel​

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

Returns

TypeDescription
integerthe log level

Optimal

GetMap​

Returns the current map package name
local ret = Client.GetMap()

Returns

TypeDescription
stringthe current Map

Optimal

GetNearClipPlane​

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

Returns

TypeDescription
floatNear Clip Plane value

See also SetNearClipPlane.


Slow

GetPackages​

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

Parameters

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

Returns

TypeDescription
table of tablea list of Packages data with this format

Slow

GetSettings​

Gets the local player's game Settings
local ret = Client.GetSettings()

Returns

TypeDescription
tablethe current Settings with this format

Optimal

GetTime​

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

Returns

TypeDescription
integerthe unix timestamp

Moderate

GetValue​

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

Parameters

TypeParameterDefaultDescription
stringkey Required parameter The key
anyfallback Required parameter Value returned if the key doesn't exist

Returns

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

See also GetAllValuesKeys, SetValue.


Moderate

IsPackageLoaded​

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

Parameters

TypeParameterDefaultDescription
stringpackage_name Required parameter The package folder name

Returns

TypeDescription
booleanif the package is loaded

Optimal

OpenEscapeMenu​

Opens the escape menu
Client.OpenEscapeMenu(open_settings?)

Parameters

TypeParameterDefaultDescription
booleanopen_settings?false
If true, opens the Settings tab directly

Moderate

SetDebugEnabled​

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

Parameters

TypeParameterDefaultDescription
booleanenable_debug Required parameter Whether to enable Debug settings and Client Console to be used

Moderate

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

Optimal

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 The color to use
integerindex Required parameter Highlight slot index (0 to 2)
HighlightModemode?HighlightMode.Always
When the highlight is visible

Optimal

SetNearClipPlane​

Sets the Near Clip Plane
Client.SetNearClipPlane(near_clip_plane)

Parameters

TypeParameterDefaultDescription
floatnear_clip_plane Required parameter The new Near Clip Plane

See also GetNearClipPlane.


Optimal

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 The color to use
integerindex?0
Outline slot index (0 to 2)
floatthickness?2
Line thickness

Optimal

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.0
The new gamma value if overriding

Moderate

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 Value

See also GetAllValuesKeys, GetValue, ValueChange.


Moderate

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 The text of the notification
NotificationTypenotification_type?NotificationType.Info
The notification style
booleanadd_to_notification_list?true
Whether to add this notification to the notification list (accessible from the bell icon on the top-right corner)
floatduration?10
Duration in seconds to display the notification

Optimal

Subscribe​

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

Parameters

TypeParameterDefaultDescription
stringevent_name Required parameter The name of the event
functioncallback Required parameter The function to be called

Returns

TypeDescription
functionthe function callback itself

Optimal

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 The name of the event
functioncallback?nil
The function to be called

🚀 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_playerThe local Player

Tick​

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

Arguments

TypeArgumentDescription
floatdelta_timeSeconds since the last frame

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