Skip to content

Cmd

Methods of Cmd objects. Nyx Lua API v1.

createmove

Cmd:has(button: string) -> boolean

A button is held in this command.

createmove

Cmd:set(button: string, down: boolean) -> ()

Holds or releases a button (attack, attack2, jump, duck, use, reload, walk, forward, back, left, right).

createmove

Cmd:view_angles() -> vector?

The command's angles (pitch, yaw, roll).

createmove

Cmd:set_view_angles(angles: vector) -> boolean

Aims the command (the camera does not turn); false when refused: the first writer in a command wins (Nyx's aim, or an earlier set_view_angles). On Valve servers the angle stays within 10 degrees of the camera (Nyx's aim cone there) and turns at most 35 degrees per command; going back to the camera afterwards is held to the same limits.

createmove

Cmd:move() -> (number, number)

Forward and side move, -1 to 1 (side: positive = left).

createmove

Cmd:set_move(forward: number, side: number) -> ()

Sets forward and side move, clamped to -1..1 (side: positive = left).

createmove

Cmd:tick() -> number

The command's tick.

createmove

Cmd:number() -> number

The command number.