Skip to content

client

Description

General game and client related functions


error, log

client.error(msg, type: optional) client.log(msg, type: optional)

Prints an error/log using any of the three types:

0: Notification
1: Console
2: Chat

Default is 0.

exec

client.exec(...)

Executes a chat command.

fps

client.fps()

Returns the average FPS of the game.

go_to

client.go_to(x, y, z)

Uses the internal pathfinder to walk to coordinates.

key_state

client.key_state(key: number)

Returns true if the key is pressed or nil on failure.

latency

client.latency()

Returns game server latency in miliseconds.

msg

client.msg(...)

Sends a chat message.

pos

client.pos()

Returns the local player position.

rot

client.rot(pitch, yaw, x: optional)

Gets or sets the local player’s rotation. x: bool determines if the smoothing algorithm will be used.

set_event_callback

client.set_event_callback(event_name, callback)

Registers the function as a callback for the specified event.

spectator

client.spectator()

Returns the UUIDs of all players looking towards you.

tps

client.tps()

Returns server tickrate.

unset_event_callback

client.unset_event_callback(event_name, callback)

Removes a callback that was previously registered for the specified event.

visible

client.visible(x, y, z)

Returns true if the position is visible from the local player eye position.

window_size

client.window_size()

Returns the window size in pixels.