Chicken ESP
Last updated
Last updated
local cached_chickens = {}; -- here's where were going to store all the chickens positions.
cheat.set_callback("update", function() -- fired every few ms
cached_chickens = {} -- clearing the previous positions
local chickens = entity.get_all("C_Chicken") -- returns an array of chicken entities
for _, chicken in ipairs(chickens) do
local base = chicken:get_address() -- get the base address in memory of this chicken
-- when reading memory we don't want to do it every single frame, we can get away with doing it every few ms thats why we do it here rather than paint.
local node = memory.read_address(base + game.get_schema("C_BaseEntity", "m_pGameSceneNode"));
local vorigin = memory.read_vector(node + game.get_schema("CGameSceneNode", "m_vecOrigin"));
-- store the chickens position in the table
cached_chickens[#cached_chickens + 1] = { pos = vorigin }
end
end)
cheat.set_callback("paint", function()
local me = entity.get_local_player()
local head_pos = vector(me:bone_position(7));
for _, chicken in ipairs(cached_chickens) do
local screen = vector(utility.world_to_screen(chicken.pos:unpack()))
local text_size = vector(render.measure_text(1, true, "Chicken"));
render.text(screen.x - text_size.x/2, screen.y - text_size.y/2, 155, 255, 155, 255, 1, true, "Chicken")
end
end)