evasivedocs
Roblox scriptingLuau 0.748 · 24 guides · 385 API entries
Examples

Aim target readout

evasive's own aim assist and triggerbot tell scripts what they are looking at. This script draws a line from the centre of the screen to the aim assist's current target, with the target's name and distance under the line's end. When the triggerbot has someone under the cursor, the line turns red.

Turn on aim assist in the Aim tab first. Without it there is never a target, and the script simply shows nothing.

Luau
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")

local line = Drawing.new("Line")
line.Thickness = 1.5

local label = Drawing.new("Text")
label.FontSize = 13
label.Center = true
label.Outline = true
label.Color = Color3.new(1, 1, 1)

local AIMING = Color3.fromRGB(255, 220, 0)
local ON_TARGET = Color3.fromRGB(255, 60, 60)

local function nameOf(model)
    local player = Players:FindFirstChild(model.Name)
    if player and player:IsA("Player") then
        return player.DisplayName
    end
    return model.Name
end

RunService.RenderStepped:Connect(function()
    local target = getaimtarget()
    local head = target and target:FindFirstChild("Head")
    local point, onScreen
    if head then
        point, onScreen = WorldToScreen(head.Position)
    end

    if not onScreen then
        line.Visible = false
        label.Visible = false
        return
    end

    local camera = workspace.CurrentCamera
    local distance = (head.Position - camera.Position).Magnitude
    local triggered = gettriggertarget() == target

    line.From = camera.ViewportSize / 2
    line.To = point
    line.Color = triggered and ON_TARGET or AIMING
    line.Visible = true

    label.Text = string.format("%s  %dm", nameOf(target), math.floor(distance))
    label.Position = point + Vector2.new(0, 10)
    label.Visible = true
end)

What the two functions return

  • getaimtarget() is the character Model of the player the aim assist has locked onto, or nil. For a bot or a custom rig it is that Model.
  • gettriggertarget() works the same way for whatever the triggerbot currently has under the cursor.

Both read what evasive's features already decided. They do not aim or shoot anything themselves, and they cost nothing to call every frame.

A player's character is named after the player in most games, which is what nameOf relies on. If the game names characters differently, it falls back to the model's own name.