Документация
  • 🐤Вступление
  • 🍌Официальный сайт
  • 👨‍🏫Уроки
    • ⬇️Подготовка
    • 📂Создание первого скрипта
    • 👩‍💻Основы lua
      • Переменные
      • Условные операторы
      • Функции
      • Циклы
    • ✈️События
    • 🌳Отрисовка интерфейсов
    • 🔒Защита скрипта
    • ❓Что делать если нужной функции нет в api
  • 🎓API
    • ✈️События
      • Update
      • Tick
      • Render 2D
      • Render 3D
      • Send Packet
      • Receive Packet
      • Motion
      • Attack
      • Key
      • Chat
      • Jump
      • Shutdown
      • Kill
      • Totem Break
      • Death
      • Input
      • MoveFix
      • Notification
      • Swing
    • 📚Библиотеки
      • Script
      • Client
      • Player
      • Render
      • World
      • Files
      • GL11
      • Math
    • 🌎Объекты
      • Сущность
      • Модуль
        • Настройка
      • Цвет
      • Вектор
      • Матрица
      • Звук
      • Анимация
      • Таймер
      • Драг
      • Зелье
      • Меню
  • 🔡Примеры
    • 🚄Speed
    • 💅Swing Animations
    • ⚔️Aura
    • 📈MotionGraph
    • 〽️Watermark
    • 🇨🇳ChinaHat
    • 🔀Tracers
    • 🎯TargetHud
    • 📑Tabs
    • 🔐Система хвидов
Powered by GitBook
On this page

Was this helpful?

  1. Примеры

TargetHud

:(

script:name("Testing")
script:devs({"ConeTin"})
script:desc("Mamu ebal errorok")

anim = animation.new()
prev = nil
thud = drag.new("TargetHud"):set_width(100):set_height(35):set_x(client:screen_width() / 2 - 50):set_y(client:screen_height() - 150)


events.render_2d:set(function(event)
    target = client:aura_target()
    
    anim:animate(target ~= nil and 1 or 0, 50)

    if target ~= nil then
        prev = target
    end
    if prev ~= nil then
        x = thud:x()
        y = thud:y()
        width = thud:width()
        height = thud:height()
        size = 25 - prev:hurt_time() / 5
        sizepadding = prev:hurt_time() / 10;
        
        
        render:rect(x * anim:get(),y,width,height,4,color.new(1,1,1, anim:get()))
       
        health = color.new(0,1,0)
        if prev:health() < 15 then
            health = color.new(1,1,0)
        end

        if prev:health() < 10 then
            health = color.new(1,0.5,0)
        end
        
        if prev:health() < 5 then
            health = color.new(1,0,0)
        end

        render:text(prev:name(), x * anim:get() + 5, y + 6, color.new(0,0,0,anim:get()))
        render:text("Health: ", x * anim:get() + 5, y + 16, color.new(0,0,0,anim:get()))
        render:text(math:floor(prev:health()), x * anim:get() + 5 + render:text_width("Health: "), y + 16, render:alpha(health,anim:get()))
    end

end)
PreviousTracersNextTabs

Last updated 5 months ago

Was this helpful?

🔡
🎯