Cmd
Methods of Cmd objects. Nyx Lua API v1.
Cmd:has
Section titled Cmd:hascreatemove
Cmd:has(button: string) -> booleanA button is held in this command.
Cmd:set
Section titled Cmd:setcreatemove
Cmd:set(button: string, down: boolean) -> ()Holds or releases a button (attack, attack2, jump, duck, use, reload, walk, forward, back, left, right).
Cmd:view_angles
Section titled Cmd:view_anglescreatemove
Cmd:view_angles() -> vector?The command's angles (pitch, yaw, roll).
Cmd:set_view_angles
Section titled Cmd:set_view_anglescreatemove
Cmd:set_view_angles(angles: vector) -> booleanAims 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.
Cmd:move
Section titled Cmd:movecreatemove
Cmd:move() -> (number, number)Forward and side move, -1 to 1 (side: positive = left).
Cmd:set_move
Section titled Cmd:set_movecreatemove
Cmd:set_move(forward: number, side: number) -> ()Sets forward and side move, clamped to -1..1 (side: positive = left).
Cmd:tick
Section titled Cmd:tickcreatemove
Cmd:tick() -> numberThe command's tick.
Cmd:number
Section titled Cmd:numbercreatemove
Cmd:number() -> numberThe command number.
Nyx Lua API v1 · release commit-4b659d9c3810 · d0f772c99281