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

⌨️ Client

Static Class present on Client side

🗿Static ClassClient Only🧑‍💻API Source

🗿 Static Functions​

Appearance
GetNearClipPlane: floatGets the Near Clip Plane value
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
Data
GetAllValuesKeys: table of stringGets a list of all values keys
GetValue: anyGets a value given a key
SetValueSets a global value in the Client, which can be accessed from anywhere (client side)
Diagnostics
GetFrameTime: floatGets the current Frame Time
GetLogLevel: integerReturns the current log level
GetTime: integerGets the Unix Epoch Time in milliseconds
SetDebugEnabledEnables/Disables Debug settings and Client Console to be used
Interface
CopyToClipboardCopies a text to Clipboard
OpenEscapeMenuOpens the escape menu
SetEscapeMenuTextSets the Escape Menu text as Markdown
ShowNotificationShows a notification using the built-in notification system
Packages
GetPackages: table of tableReturns a list of Packages running
IsPackageLoaded: booleanReturns if a Package is currently loaded
Queries
GetActorsInRadius: table of Base ActorReturns the actors within the specified radius
GetEntityByID: Base Entity or nilReturns the entity with the specified ID
Session
DisconnectDisconnects from the server
GetConnectedServerIP: stringGets the current connected server IP:Port
GetLocalPlayer: PlayerGets the local Player
GetMap: stringReturns the current map package name
Subscribe: functionSubscribes for an Event
UnsubscribeUnsubscribes from all subscribed Events in this Class and in this Package, optionally passing the function to unsubscribe only that callback
Settings
GetLanguage: stringGets the current language of the Client
GetSettings: tableGets the local player's game Settings
IsVOIPSelfMuted: booleanGets whether the local player has muted their own microphone

Appearancestatic functions​

GetNearClipPlaneOptimal​

Gets the Near Clip Plane value

local ret = Client.GetNearClipPlane()
Returns
TypeDescrição
floatNear Clip Plane value

See also SetNearClipPlane.

SetHighlightColorOptimal​

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
NameTypeDescrição
highlight_colorColorThe color to use
indexintegerHighlight slot index (0 to 2)
mode?HighlightModeWhen the highlight is visible Default HighlightMode.Always

SetNearClipPlaneOptimal​

Sets the Near Clip Plane

Client.SetNearClipPlane(near_clip_plane)
Parameters
NameTypeDescrição
near_clip_planefloatThe new Near Clip Plane

See also GetNearClipPlane.

SetOutlineColorOptimal​

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
NameTypeDescrição
outline_colorColorThe color to use
index?integerOutline slot index (0 to 2) Default 0
thickness?floatLine thickness Default 2

SetSettingGammaOverrideOptimal​

Overrides the gamma setting and prevents the client from changing it

Client.SetSettingGammaOverride(override, new_gamma?)
Parameters
NameTypeDescrição
overridebooleanWhether to override the gamma setting
new_gamma?float or nilThe new gamma value if overriding Default 1.0

Datastatic functions​

GetAllValuesKeysModerate​

Gets a list of all values keys

local ret = Client.GetAllValuesKeys()
Returns
TypeDescrição
table of stringa list with all values keys

See also GetValue, SetValue.

GetValueModerate​

Gets a value given a key

local ret = Client.GetValue(key, fallback)
Parameters
NameTypeDescrição
keystringThe key
fallbackanyValue returned if the key doesn't exist
Returns
TypeDescrição
anyValue at key or fallback if key doesn't exist

See also GetAllValuesKeys, SetValue.

SetValueModerate​

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
NameTypeDescrição
keystringKey
valueanyThe value, can be any serializable type (not functions)

See also GetAllValuesKeys, GetValue, ValueChange.

Diagnosticsstatic functions​

GetFrameTimeOptimal​

Gets the current Frame Time

local ret = Client.GetFrameTime()
Returns
TypeDescrição
floatthe Frame Time

GetLogLevelOptimal​

Returns the current log level

local ret = Client.GetLogLevel()
Returns
TypeDescrição
integerthe log level

GetTimeOptimal​

Gets the Unix Epoch Time in milliseconds

local ret = Client.GetTime()
Returns
TypeDescrição
integerthe unix timestamp

SetDebugEnabledModerate​

Enables/Disables Debug settings and Client Console to be used

Client.SetDebugEnabled(enable_debug)
Parameters
NameTypeDescrição
enable_debugbooleanWhether to enable Debug settings and Client Console to be used

Interfacestatic functions​

CopyToClipboardOptimal​

Copies a text to Clipboard

Client.CopyToClipboard(text)
Parameters
NameTypeDescrição
textstringThe text to copy

OpenEscapeMenuOptimal​

Opens the escape menu

Client.OpenEscapeMenu(open_settings?)
Parameters
NameTypeDescrição
open_settings?booleanIf true, opens the Settings tab directly Default false

SetEscapeMenuTextModerate​

Sets the Escape Menu text as Markdown

Client.SetEscapeMenuText(text)
Parameters
NameTypeDescrição
textstringThe text to display, supports Markdown formatting
Examples (1)
Adding customized texts
Client.SetEscapeMenuText([[
# Welcome to the server

Read the **rules** before playing!

- Be respectful
- Have fun
]])

ShowNotificationModerate​

Shows a notification using the built-in notification system

Client.ShowNotification(text, notification_type?, add_to_notification_list?, duration?)
Parameters
NameTypeDescrição
textstringThe text of the notification
notification_type?NotificationTypeThe notification style Default NotificationType.Info
add_to_notification_list?booleanWhether to add this notification to the notification list (accessible from the bell icon on the top-right corner) Default true
duration?floatDuration in seconds to display the notification Default 10

Packagesstatic functions​

GetPackagesSlow​

Returns a list of Packages running

local ret = Client.GetPackages(package_type_filter?)
Parameters
NameTypeDescrição
package_type_filter?PackageTypeWhich Package type to return. Leave it default to return all types Default PackageType.All
Returns
TypeDescrição
table of tablea list of Packages data
Table keys
NameTypeDescrição
titlestringNo description provided
namestringNo description provided
typePackageTypeNo description provided
versionstringNo description provided
authorstringNo description provided

IsPackageLoadedModerate​

Returns if a Package is currently loaded

local ret = Client.IsPackageLoaded(package_name)
Parameters
NameTypeDescrição
package_namestringThe package folder name
Returns
TypeDescrição
booleanif the package is loaded

Queriesstatic functions​

GetActorsInRadiusModerate​

Returns the actors within the specified radius

local ret = Client.GetActorsInRadius(location, radius, only_classes?)
Parameters
NameTypeDescrição
locationVectorThe center location of the search
radiusnumberThe search radius
only_classes?table of stringOnly actors of these classes will be returned (pass empty for all classes) Default []
Returns
TypeDescrição
table of Base ActorThe actors found in radius

GetEntityByIDModerate​

Returns the entity with the specified ID

local ret = Client.GetEntityByID(entity_id)
Parameters
NameTypeDescrição
entity_idintegerThe entity ID
Returns
TypeDescrição
Base Entity or nilthe entity

Sessionstatic functions​

DisconnectSlow​

Disconnects from the server

Client.Disconnect()

GetConnectedServerIPOptimal​

Gets the current connected server IP:Port

local ret = Client.GetConnectedServerIP()
Returns
TypeDescrição
stringCurrent connected server IP:Port

GetLocalPlayerOptimal​

Gets the local Player

local ret = Client.GetLocalPlayer()
Returns
TypeDescrição
Playerthe local Player

GetMapOptimal​

Returns the current map package name

local ret = Client.GetMap()
Returns
TypeDescrição
stringthe current Map

SubscribeOptimal​

Subscribes for an Event

local ret = Client.Subscribe(event_name, callback)
Parameters
NameTypeDescrição
event_namestringThe name of the event
callbackfunctionThe function to be called
Returns
TypeDescrição
functionthe function callback itself

UnsubscribeOptimal​

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
NameTypeDescrição
event_namestringThe name of the event
callback?functionThe function to be called Default nil

Settingsstatic functions​

GetLanguageOptimal​

Gets the current language of the Client

local ret = Client.GetLanguage()
Returns
TypeDescrição
stringthe language code

GetSettingsSlow​

Gets the local player's game Settings

local ret = Client.GetSettings()
Returns
TypeDescrição
tablethe current Settings
Table keys
NameTypeDescrição
ToggleSprintbooleanWhether Sprint is a toggle instead of hold
ToggleCrouchbooleanWhether Crouch is a toggle instead of hold
ToggleAimbooleanWhether Aim is a toggle instead of hold
ToggleWalkbooleanWhether Walk is a toggle instead of hold
MouseSensitivityfloatMouse sensitivity multiplier
AutoReAlignCamerabooleanWhether the camera automatically re-aligns behind the Character
FOVCanChangebooleanWhether the FOV is allowed to change while aiming or sprinting
CameraBendingintegerCamera bending intensity (0-100)
EnableCustomLoadingScreenbooleanWhether Packages are allowed to display a custom loading screen
VolumeMusicintegerIn-game music volume (0-100)
VolumeMenuMusicintegerMain menu music volume (0-100)
VolumeUIintegerUI sounds volume (0-100)
VolumeSFXintegerSound effects volume (0-100)
VolumeAmbientintegerAmbient sounds volume (0-100)
VolumeOverallintegerMaster volume (0-100)
VolumeVoiceintegerVoice chat volume (0-100)
VoicePushToTalkbooleanWhether voice chat uses push to talk (false means open mic)
PlaySoundInDesktopbooleanWhether the game keeps playing sound while unfocused
PlayTypingSoundsbooleanWhether typing in text inputs plays key sounds
GammaintegerScreen gamma (0-100)
MotionBlurintegerMotion blur amount (0-100)
FOVintegerField of View (0-100)
GameMaxFPSintegerFPS limit, or 0 for uncapped
RayTracingbooleanWhether Ray Tracing is enabled
HardwareRayTracingbooleanWhether hardware Ray Tracing is enabled
RHIintegerRendering API: 0 = DX11, 1 = DX12, 2 = Vulkan
BloodDecalQualityLevelintegerBlood decals: 0 = None, 1 = Simple Decals, 2 = Vehicle Supported
AntiAliasingMethodintegerAnti-Aliasing: 0 = OFF, 1 = FXAA, 2 = TAA, 3 = MSAA, 4 = TSR, 5 = SMAA
ShadowMapMethodintegerShadows: 0 = Shadow Maps, 1 = Virtual Shadow Maps
MegaLightsbooleanWhether MegaLights is enabled
UpscalingMethodintegerUpscaling: 0 = OFF, 1 = TSR, 2 = AMD FSR, 3 = NVIDIA DLSS
UpscalingQualityintegerUpscaling quality: 0 = Native/DLAA, 1 = Quality, 2 = Balanced, 3 = Performance, 4 = Ultra Performance
UpscalingSharpnessintegerUpscaling sharpness (0-100)
FrameGenerationMethodintegerFrame Generation: 0 = OFF, 1 = AMD FSR FG, 2 = NVIDIA DLSS FG
LatencyReductionMethodintegerLatency Reduction: 0 = OFF, 1 = AMD Anti Lag 2, 2 = NVIDIA Reflex, 3 = NVIDIA Reflex + Boost
DLSSFrameGenerationModeintegerDLSS Frame Generation: 0 = Auto, 1 = Dynamic, 2 = 2X, 3 = 3X, 4 = 4X, 5 = 5X, 6 = 6X
DLSSRayReconstructionbooleanWhether DLSS Ray Reconstruction is enabled
CEFSharedTexturebooleanWhether WebUIs use a shared texture (experimental)
CEFUseHardwareAccelerationbooleanWhether WebUIs use hardware acceleration (experimental)
CEFUseMessageLoopSchedulebooleanWhether WebUIs use a scheduled message loop
CEFUseExternalBeginFramebooleanWhether WebUIs use an external begin frame
CEFMaxFrameRateintegerWebUI frame rate limit
CEFMaxResolutionintegerWebUI resolution limit, or 0 for unlimited
ScreenResolutionVector2DScreen resolution in pixels
FullscreenModeintegerWindow mode: 0 = Fullscreen, 1 = Windowed Fullscreen, 2 = Windowed
VSyncbooleanWhether VSync is enabled
ResolutionScalefloatNormalized 3D resolution scale (0-1)
OverallQualityintegerOverall quality preset: 0 = Low, 1 = Medium, 2 = High, 3 = Epic, 4 = Cinematic, or -1 when the individual quality levels do not all match
ViewDistanceQualityintegerView Distance quality (0 = Low to 4 = Cinematic)
ShadowQualityintegerShadow quality (0 = Low to 4 = Cinematic)
GlobalIlluminationQualityintegerGlobal Illumination quality (0 = Low to 4 = Cinematic)
ReflectionQualityintegerReflection quality (0 = Low to 4 = Cinematic)
AntiAliasingQualityintegerAnti-Aliasing quality (0 = Low to 4 = Cinematic)
TextureQualityintegerTexture quality (0 = Low to 4 = Cinematic)
VisualEffectQualityintegerVisual Effects quality (0 = Low to 4 = Cinematic)
PostProcessingQualityintegerPost Processing quality (0 = Low to 4 = Cinematic)
FoliageQualityintegerFoliage quality (0 = Low to 4 = Cinematic)
ShadingQualityintegerShading quality (0 = Low to 4 = Cinematic)

IsVOIPSelfMutedOptimal​

Gets whether the local player has muted their own microphone

Only the player can change it, with the VOIP key when the Open Mic setting is on, or from the escape menu

local ret = Client.IsVOIPSelfMuted()
Returns
TypeDescrição
booleanWhether the microphone is muted by the player

🚀 Events​

LanguageChangeCalled when the Client language changes
PackageLoadTriggered when any package is loaded
PackageUnloadTriggered when any package is unloaded
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)
VOIPSelfMuteChangeCalled when the local player mutes or unmutes their own microphone, either with the VOIP key (on Open Mic) or from the escape menu
WindowFocusChangeCalled when the game is focused/unfocused

LanguageChange​

Called when the Client language changes

Client.Subscribe("LanguageChange", function(language)
-- LanguageChange was called
end)
Arguments
NameTypeDescrição
languagestringThe new language code

PackageLoad​

Triggered when any package is loaded

Client.Subscribe("PackageLoad", function(package_name)
-- PackageLoad was called
end)
Arguments
NameTypeDescrição
package_namestringThe package name (its folder name)

See also GetPackages, IsPackageLoaded.

PackageUnload​

Triggered when any package is unloaded

Client.Subscribe("PackageUnload", function(package_name)
-- PackageUnload was called
end)
Arguments
NameTypeDescrição
package_namestringThe package name (its folder name)

See also GetPackages, IsPackageLoaded.

SpawnLocalPlayer​

Called when the local player spawns (just after the game has loaded)

Client.Subscribe("SpawnLocalPlayer", function(local_player)
-- SpawnLocalPlayer was called
end)
Arguments
NameTypeDescrição
local_playerPlayerThe local Player

Tick​

Called Every Frame. Do not abuse

Client.Subscribe("Tick", function(delta_time)
-- Tick was called
end)
Arguments
NameTypeDescrição
delta_timefloatSeconds 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
NameTypeDescrição
keystringThe key that changed
valueanyThe new value

See also SetValue, Server.SetValue().

VOIPSelfMuteChange​

Called when the local player mutes or unmutes their own microphone, either with the VOIP key (on Open Mic) or from the escape menu

Client.Subscribe("VOIPSelfMuteChange", function(is_muted)
-- VOIPSelfMuteChange was called
end)
Arguments
NameTypeDescrição
is_mutedbooleanWhether the microphone is now muted

WindowFocusChange​

Called when the game is focused/unfocused

Client.Subscribe("WindowFocusChange", function(is_focused)
-- WindowFocusChange was called
end)
Arguments
NameTypeDescrição
is_focusedbooleanIf it's focused