Lua, Триггер-бот, рендеринг текста, силуэты, векторная наводка

Забаненный
Статус
Оффлайн
Регистрация
16 Фев 2021
Сообщения
45
Реакции[?]
40
Поинты[?]
0
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
code_language.lua:
ACEID_API = {}
FUNCTIONS_TABLE = {}

function ACEID_API:new()
    local Methods = {}
    local Markers = {}

    Methods.ENABLED = 1;
    Methods.DISABLED = 0;

    -- Возвращает таблицу локального игрока
    function Methods:GetClientActor()
        return g_localActor;
    end

    -- Возвращает таблицу текущего предмета игрока
    function Methods:GetCurrentItem()
        return self:GetClientActor().inventory:GetCurrentItem();
    end

    -- Возвращает таблицу текущего оружия игрока
    function Methods:GetWeapon()
        return self:GetCurrentItem().weapon;
    end

    -- Возвращает массив всех сущностей на карте
    function Methods:GetEntities()
        return System.GetEntities();
    end

    -- Возвращает массив всех игроков на карте
    function Methods:GetPlayers()
        return System.GetEntitiesByClass("Player");
    end

    -- Получаем здоровье игрока
    function Methods:GetHealth(Target)
        if (Target.actor ~= nil) then
            return Target.actor:GetHealth();
        else
            return 0;
        end
    end
  
    -- Проверяем жив ли Actor
    function Methods:IsDead(Target)
        return self:GetHealth(Target) <= 0;
    end

    -- Получаем идентификатор команды
    function Methods:GetTeam(Target)
        if (g_gameRules.game ~= nil) then
            return g_gameRules.game:GetTeam(Target.id);
        else
            return 0;
        end
    end

    -- Сравниваем две команды
    function Methods:IsSameTeam(First, Second)
        return self:GetTeam(First) == self:GetTeam(Second)
    end

    -- Возращает TRUE если видно Entity
    function Methods:IsVisible(Target)
        return System.RayTraceCheck(System:GetViewCameraPos(), Target:GetBonePos("Bip01 Spine3"), 0, 0);
    end

    -- Меняем расположение камеры игрока на заданную позицию
    function Methods:SetViewPosition(Position)

        local Difference = DifferenceVectors(Position, System:GetViewCameraPos());
        Difference = NormalizeVector(Difference);

        self:GetClientActor():SetDirectionVector(Difference);
    end

    -- Возвращает позицию, сущность при столкновении луча
    function Methods:RayCast()
        local Position = System.GetViewCameraPos();
        local ScaledDirection = ScaleVector(System.GetViewCameraDir(), 100);
  
        local Result = { }
        Physics.RayWorldIntersection(Position, ScaledDirection, 1, ent_terrain + ent_static + ent_rigid + ent_sleeping_rigid + ent_living, g_localActor.id, NULL_ENTITY, Result);
  
        return Result[1]
    end

    -- Производит выстрелы
    function Methods:Shot(Count, Reload)
        self:GetWeapon():AutoShoot(Count, Reload)
    end

    -- Перезарядка оружия
    function Methods:Reload()
        self:GetWeapon():Reload()
    end

    -- Получает таблицу Screen
    function Methods:GetScreen()
        return UI.CurrentScreen;
    end

    -- Открывает игровую консоль
    function Methods:ShowConsole(Show)
        System.ShowConsole(Show);
    end

    setmetatable(Methods, self)
    self.__index = self;

    return Methods;
end

Aceid = ACEID_API:new();

code_language.lua:
if (System ~= nil and Script ~= nil and FeedbackSystem ~= nil) then

    local Actor = Aceid:GetClientActor();
    local Entities = Aceid:GetEntities();

    if (Actor ~= nil and Entities ~= nil) then

        -- Aimbot raycast
        if (Config.Aimbot == Aceid.ENABLED) then
            local RayHit = Aceid:RayCast();
            if (RayHit ~= nil and RayHit.entity
            and (Aceid:IsDead(Entity) == false)
            and (Aceid:IsSameTeam(Actor, Entity) == false or Aceid:GetTeam(Actor) == 0)) then
                if (Actor.actor:IsFiring()) then
                    Aceid:SetViewPosition(RayHit.entity:GetBonePos("Bip01 Neck"));
                end
            end
        end

        -- TriggerBot
        if (Config.TriggerBot == Aceid.ENABLED) then
            local RayHit = Aceid:RayCast();
            if (RayHit ~= nil and RayHit.entity) then
              
                local Entity = RayHit.entity;
                if (Entity.actor ~= nil)
                and (Aceid:IsDead(Entity) == false)
                and (Aceid:IsSameTeam(Actor, Entity) == false or Aceid:GetTeam(Actor) == 0)
                then
                    Script.SetTimer(150, -- Задержка выстрела 150 миллисекунд
                        function()
                            Aceid:Shot(1, 1);
                        end
                    );
                end
            end
        end

        -- Общий итератор Entity
        for i in pairs(Entities)
        do
            local Entity = Entities[i]

            if (Entity ~= nil and Entity.actor)
            and (Entity ~= Actor)
            and (Aceid:IsDead(Entity) == false)
            and (Aceid:IsSameTeam(Actor, Entity) == false or Aceid:GetTeam(Actor) == 0)
            then
                -- Silhouettes
                if (Config.Silhouettes == Aceid.ENABLED and FeedbackSystem ~= nil) then

                    local MarkerId = 0;

                    if (Aceid:IsVisible(Entity)) then
                        MarkerId = FeedbackSystem.AddMarker("observer_silhouette_warface", Entity.id);
                    else
                        MarkerId = FeedbackSystem.AddMarker("observer_silhouette_blackwood", Entity.id);
                    end
                end

                -- Health, Armor text render
                if (Config.Names == Aceid.ENABLED) then
                    System.DrawLabel(Entity:GetBonePos("Bip01 Spine3"), 1.2, string.format("Health: %d\nArmor: %d", Entity.actor:GetHealth(), Entity.actor:GetArmor()), 0, 1, 1, 0.9)
                end

                -- Aimbot
                if (Aceid:IsDead(Actor) == false) then
                    if (Config.Aimbot == Aceid.ENABLED) then
                        if (Aceid:IsVisible(Entity)) then
                            local Position = Entity:GetBonePos("Bip01 Head");
                            Aceid:SetViewPosition(Position);
                        end
                    end
                end
            end
        end
    end

    System.DrawText(10, 5, "Aceid.cc Lua Executor", "warface", 12, 1.0, 1.0, 1.0, 1.0);
    System.DrawText(10, 15, string.format("State: %d", System.GetCVar("g_victoryCondition")), "warface", 8, 1.0, 1.0, 1.0, 1.0);
end
 
Начинающий
Статус
Оффлайн
Регистрация
22 Окт 2022
Сообщения
3
Реакции[?]
0
Поинты[?]
0
Как же запустить?
 
Сверху Снизу