Skip to main content
These let you narrow what the legitbot does. Each returns a handle you can :Release() to undo, and is auto-released on script unload (same as Overrides).

addTargetFilter

api.legitbot.addTargetFilter(
    fn: (player: Player, info: TargetFilterInfo) -> boolean,
    priority: number?
): RegistrationHandle
Your fn is called once per candidate player. Return false to exclude them. If multiple filters exist, a player has to pass all of them.

addShotGate

api.legitbot.addShotGate(
    fn: (shot: ShotGateInfo) -> boolean,
    priority: number?
): RegistrationHandle
Your fn is called right before each shot. Return false to block it. All gates have to pass for the shot to fire.

addAimTransform

api.legitbot.addAimTransform(
    fn: (aim: AimTransformInfo) -> Vector3?,
    priority: number?
): RegistrationHandle
Your fn receives the planned aim point. Return a new Vector3 to use instead, or nil to leave it alone. Lower priorities run first; the highest priority runs last and has the final say.

forceTarget

api.legitbot.forceTarget(
    player: Player | string | number,
    durationSec: number?
): ForceTargetHandle?
Only let the legitbot target one specific player. Accepts a Player, a player name, or a UserId. Returns nil if no matching player is in the server. Without a duration, it stays until you :Release() or your script unloads. Calling again replaces the previous force-target.

clearForcedTarget

api.legitbot.clearForcedTarget(): ()

requestShot

api.legitbot.requestShot(): ()
Fire the next available shot, skipping the normal cooldown. Does not skip your filters, gates, FOV, autowall, mode, hit chance, or min damage. The request only lasts one frame.

RegistrationHandle

handle:Release()           -- undo the registration
handle:IsReleased()        -- true if already released
handle:GetPriority()       -- current priority
handle:SetPriority(n)      -- change priority

ForceTargetHandle

handle:Release()           -- stop forcing
handle:IsReleased()        -- true if already released
handle:GetPlayer()         -- the forced player

Examples

-- Don't fire at a specific player
local friend = "Roblox"
api.legitbot.addShotGate(function(shot)
    return shot.player ~= nil and shot.player.Name ~= friend
end)

-- Bias the aim point upward by 0.1 studs (lift toward head)
api.legitbot.addAimTransform(function(aim)
    return aim.aimPoint + Vector3.new(0, 0.1, 0)
end, 10)

-- Force a shot on the next frame
api.legitbot.requestShot()