snippets
Те же шаблоны, что подставляет редактор скриптов. Скопируйте и поменяйте под себя.
snippet:esp-text— ESP с текстом xyz в углу экрана
local color = ui.color("Color", render.rgba(255, 255, 255, 255))
events.on("render2d", function()
if not player.exists() then return end
local x, y, z = player.pos()
render.text(string.format("xyz %.1f %.1f %.1f", x, y, z), 10, 10, color:get(), true)
end)snippet:entity-esp— Боксы вокруг ближайших игроков
local radius = ui.slider("Radius", 64, 8, 256, 1)
local color = ui.color("Color", render.rgba(255, 60, 60, 200))
events.on("render3d", function()
if not world.exists() then return end
for _, e in ipairs(world.players()) do
if e.distance_to_player() <= radius:get() then
local b = e.bounding_box()
render.box3d(b.min_x, b.min_y, b.min_z, b.max_x, b.max_y, b.max_z, color:get(), 1.5, true, false)
end
end
end)snippet:storage-counter— Счётчик атак через storage
local kills = storage.get("kills", 0)
events.on("attack", function()
kills = kills + 1
storage.set("kills", kills)
client.notify("kills: " .. kills, 1500)
end)snippet:silent-aim— Силент-аим на ближайшего игрока через client.silent
local range = ui.slider("Range", 4.2, 1, 6, 0.1)
local visible = ui.checkbox("Показывать на модели", false)
events.on("tick", function()
if not player.exists() then
client.silent.clear()
return
end
local target = world.nearest_player(range:get())
if not target then
client.silent.clear()
return
end
local x, y, z = target.pos()
local yaw, pitch = util.rotation_to(x, y + 1.4, z)
client.silent.set(yaw, pitch, visible:get())
end)snippet:antiaim— AntiAim: вращение yaw и pitch вниз
local mode = ui.combo("Yaw", "Spin", { "Spin", "Jitter", "Backwards" })
local speed = ui.slider("Speed", 14, 1, 45, 1)
local visible = ui.checkbox("Показывать на модели", false)
local spin, flip = 0, false
events.on("tick", function()
if not player.exists() then return end
local yaw = select(1, player.rotation())
if mode:is("Spin") then
spin = util.wrap_degrees(spin + speed:get())
yaw = spin
elseif mode:is("Jitter") then
flip = not flip
yaw = util.wrap_degrees(yaw + (flip and 45 or -45))
else
yaw = util.wrap_degrees(yaw + 180)
end
client.silent.set(yaw, 89, visible:get())
end)snippet:custom-screen— Собственный экран на ui.screen
local key = ui.keybind("Открыть панель", 0)
local panel = ui.screen({
title = "Panel",
blur_background = true,
on_render = function(mx, my)
local theme = render.theme()
local sw, sh = render.screen_size()
local w, h = 200, 120
local x, y = (sw - w) / 2, (sh - h) / 2
render.rounded_rect(x, y, w, h, 10, render.with_alpha(theme.background, 235))
render.outline_rect(x, y, w, h, 10, theme.border, 1)
render.font_text("Панель", x + 12, y + 12, theme.text, 10, "bold")
local hovered = render.hovered(mx, my, x + 12, y + 40, w - 24, 20)
render.rounded_rect(x + 12, y + 40, w - 24, 20, 6,
hovered and theme.hover or render.with_alpha(theme.text, 20))
render.font_text_centered("Кнопка", x + w / 2, y + 46, theme.text, 8)
end,
on_click = function(x, y, button)
client.notify("click " .. button, 1000)
end,
})
events.on("key", function(ev)
if ev.pressed and key:get() ~= 0 and ev.key == key:get() then
panel.open()
end
end)snippet:hud-panel— HUD-панель в стиле клиента
local color = ui.color("Accent", render.rgba(120, 170, 255, 235))
events.on("render2d", function()
if not player.exists() then return end
local theme = render.theme()
local text = string.format("%d fps · %d ms", client.fps(), client.ping())
local w = render.font_width(text, 8) + 18
render.blur(10, 10, w, 20, 6, 8)
render.rounded_rect(10, 10, w, 20, 6, render.with_alpha(theme.background, 170))
render.circle(20, 20, 3, color:get())
render.font_text(text, 28, 16, theme.text, 8)
end)snippet:keybind-toggle— Тогл по клавише
local key = ui.keybind("Toggle", 0)
local state = false
events.on("key", function(ev)
if not ev.pressed then return end
if key:get() == 0 or ev.key ~= key:get() then return end
state = not state
client.notify("state: " .. tostring(state), 1200)
end)snippet:hold-and-command— Взять предмет из инвентаря в руку и выполнить команду
local ITEM = "minecraft:trident"
local COMMAND = "market sell 500"
local stage, wait, tries = "find", 0, 0
local function finish(text)
client.notify(text)
stage = "done"
modules.get(client.name).set(false)
end
events.on("tick", function()
if stage == "done" or not player.exists() then return end
if wait > 0 then wait = wait - 1 return end
if stage == "find" then
if player.held_item().id == ITEM then stage = "run" return end
local slot, hotbar = player.find_item(ITEM)
if not slot then return finish("нет предмета") end
if hotbar then
player.select_slot(hotbar)
else
tries = tries + 1
if tries > 3 then return finish("не удалось взять") end
player.swap_slot(slot, player.hotbar_slot())
end
wait = 2
elseif stage == "run" then
player.send_command(COMMAND)
finish("готово")
end
end)snippet:loot-chest— Забрать из открытого сундука все нужные предметы
local WANT = { ["minecraft:diamond"] = true, ["minecraft:netherite_ingot"] = true }
local cooldown = 0
events.on("tick", function()
if cooldown > 0 then cooldown = cooldown - 1 return end
local box = player.container()
if not box or not box.open then return end
for _, item in ipairs(player.inventory()) do
if not item.player and WANT[item.id] then
player.quick_move(item.slot)
cooldown = 2
return
end
end
end)