entity

Interact with cached entities, usually just player info in this case.

When using the Entity API the info is returned from what the cheat has saved for it's own usage. It's safe to use these functions within the paint callback and experience little to no performance drawbacks. This should work across all games that are supported.

Functions:

Get Players

entity.get_players(boolean: only_enemies)

Returns a table of players. If only_enemies isn't passed it will default to false. The local player and dead players will be excluded.

Get Parts

entity.get_parts()

Returns a table of all parts in the game. Refer to the methods below on how to read their information.

Get Local Player

entity.get_local_player()

Returns the local player.

Get Target

entity.get_target()

Returns the aimbot target.

Get Position

player:get_position()

Returns the player positon as vector (x, y, z).

Get Name

player:get_name()

Returns the player name as a string.

Get Bounding Box

player:get_bbox()

Returns the player bounding box as x, y, w, h which are screen coordinates.

Is Alive

player:is_alive()

Returns true if the player is alive.

Is Enemy

player:is_enemy()

Returns true if the player is an enemy

Is Visible

player:is_visible()

Returns true if the player is visible

Is Whitelisted

player:is_whitelisted()

Returns true if the player is whitelisted.

Get Health

player:get_health();

Returns the players current health as an int.

Get Velocity

player:get_velocity()

Returns the players velocity as x, y, z. You can pass these values into a vector and call the length method to get the velocity as an int.

Get User ID

player:get_user_id()

Returns the user id as a number.

Get Max Health

player:get_max_health()

Returns the players maximum health as a int.

Bone Position

player:bone_position(string: bone_name)

Returns the position of the specified bone as x, y, z. (Ex. Head)

Bone Instance

player:bone_instance(string: bone_name)

Returns the instance of the specified bone. (Ex. Head)

Get Weapon

player:get_weapon();

Returns the players currently held weapon as a string.

Get Team

player:get_team();

Returns the players team name as a string.

Get Team Color

player:get_team_color();

Returns the players team color as RGB values, Ex. [255, 0, 255]

Part Methods:

These can be used on parts IN the Entity API to obtain their information.

Get Position

part:get_part_position()

Returns the position of the specified part as x, y, z.

Get Rotation

part:get_part_rotation()

Returns the rotation of the specified part as matrix3 struct. Here's an example of it's useage:

-- this script would print the rotation matrix of all parts
    local parts = entity.get_parts()

    for index, part in ipairs(parts) do
        local rotation_matrix = part:get_part_rotation()

        print("Rotation of part " .. index .. ":")
        for i = 1, 9 do
            print(rotation_matrix[i])
        end
    end

Get Size

part:get_part_size()

Returns the size of the specified part as x, y, z. Example Useage:

cheat.set_callback("update", function()
    local parts = entity.get_parts()

    for index, part in ipairs(parts) do
        local size = vector(part:get_part_size())

        print("Size " .. index .. ":" .. size.x .. " " .. size.y .. " " .. size.z)
    end
end)

Last updated