xhookLua
Game

aimbot

Who the bots aim at, per-player overrides, bot state, and shots of your own.

Functions

aimbot.target

aimbot.target([bot]) -> Entity, hitbox, point, bot
NameTypeDescription
botoptionalstring"rage" or "legit"; omitted tries rage first.

Current target, hitbox index and aim point.

Returns nil when there is no target

  • It's the last command's pick, so inside on_create_move it's one command old.
  • A bot that stopped (off, knife out) reports nothing after 250 ms.

aimbot.state

aimbot.state([bot]) -> table
NameTypeDescription
botoptionalstring"rage" or "legit". Default rage when active, else legit.

What a bot is doing right now.

Returns {bot, active, phase, weapon_config, fov, smooth, hitchance, min_damage}

  • phase: "idle", "scanning", "waiting" or "shooting", from the last command.
  • weapon_config is the config section, like "ak47"; nil without a gun.
  • smooth and hitchance are legit only.

aimbot.set_override

aimbot.set_override(player, opts)
NameTypeDescription
playerEntity | integer
opts.ignoreoptionalbooleanNever shoot this player.
opts.force_bodyoptionalbooleanStomach and chest only.
opts.priorityoptionalintegerAdded to the on_aim_target priority.
opts.hitchanceoptionalinteger0..100, trigger only.
opts.min_damageoptionalintegerLeast damage to shoot.

Change how the bots treat one player.

  • nil instead of opts clears it. Fields left out use the menu value.
  • Each script keeps its own; they go away with the script. At most 256.

aimbot.get_override

aimbot.get_override(player) -> table
NameType
playerEntity | integer

This script's override for the player.

Returns nil when none

aimbot.clear_override

aimbot.clear_override([player])
NameTypeDescription
playeroptionalEntity | integerDefault all.

Clear one player's override, or all of this script's.

aimbot.shoot

aimbot.shoot(target [, opts]) -> boolean
NameTypeDescription
targetVector | AngleWorld point, or the angle to send.
opts.modeoptionalstring"psilent": only the shot carries the aim. "silent": every command does, view stays. "visible": view turns. Default "psilent".
opts.fireoptionalbooleanfalse aims only; you shoot. Default true.
opts.compensateoptionalbooleanRemove recoil and spread on the shot. Default true.
opts.playeroptionalEntity | integerPlayer aimed at, so on_aim_hit / on_aim_miss report it.
opts.hitboxoptionalintegerHitbox reported with the shot.

Aim this command at a point or angle and shoot when the weapon is ready.

Returns true when the weapon can fire this command

  • Call it from on_create_move, every command you want to aim.
  • Skipped on a command the rage bot aims on, and in Safe Mode.
  • Anti-aim, freecam and freelook leave the command alone.
aimbot ยท Lua API ยท xhook