LUA скрипт [Source | NL] Custom Animated Scope

Олдфаг
Статус
Оффлайн
Регистрация
28 Дек 2018
Сообщения
2,585
Реакции[?]
1,436
Поинты[?]
2K
Анимированный скоп с возможностью кастомизации
Screenshot_1.png

Пожалуйста, авторизуйтесь для просмотра ссылки.
Пожалуйста, авторизуйтесь для просмотра ссылки.
 
Последнее редактирование:
Продам киру
Начинающий
Статус
Оффлайн
Регистрация
14 Дек 2019
Сообщения
311
Реакции[?]
25
Поинты[?]
0
Анимированный скоп с возможностью кастомизации

Код:
local scope_line = {}

scope_line.var = Menu.FindVar("Visuals", "View", "Camera", "Remove Scope")
scope_line.screen = EngineClient:GetScreenSize()
scope_line.ref = scope_line.var:GetInt()

scope_line.menu = {}

scope_line.menu.offset = Menu.SliderInt("Custom Scope", "Offset", 10, 0, 500)
scope_line.menu.length = Menu.SliderInt("Custom Scope", "Length", 60, 0, 1000)
scope_line.menu.anim_speed = Menu.SliderInt("Custom Scope", "Anim Speed", 15, 1, 30)
scope_line.menu.col_1 = Menu.ColorEdit("Custom Scope", "Color 1", Color.RGBA(255, 255, 255))
scope_line.menu.col_2 = Menu.ColorEdit("Custom Scope", "Color 2", Color.RGBA(255, 255, 255, 0))

scope_line.anim_num = 0

scope_line.lerp = function(a, b, t)
    return a + (b - a) * t
end

scope_line.on_draw = function()
    scope_line.var:SetInt(2)

    local_player = EntityList.GetLocalPlayer()
    scope_line.anim_speed = scope_line.menu.anim_speed:Get()

    if not local_player or not local_player:IsAlive() or not local_player:GetProp("m_bIsScoped") then
        scope_line.anim_num = scope_line.lerp(scope_line.anim_num, 0, scope_line.anim_speed * GlobalVars.frametime)
    else
        scope_line.anim_num = scope_line.lerp(scope_line.anim_num, 1, scope_line.anim_speed * GlobalVars.frametime)
    end

    scope_line.offset = scope_line.menu.offset:Get() * scope_line.anim_num
    scope_line.length = scope_line.menu.length:Get() * scope_line.anim_num
    scope_line.col_1 = scope_line.menu.col_1:Get()
    scope_line.col_2 = scope_line.menu.col_2:Get()
    scope_line.width = 1

    scope_line.col_1.a = scope_line.col_1.a * scope_line.anim_num
    scope_line.col_2.a = scope_line.col_2.a * scope_line.anim_num
   
    scope_line.start_x = scope_line.screen.x / 2
    scope_line.start_y = scope_line.screen.y / 2

    --Left
    Render.GradientBoxFilled(Vector2.new(scope_line.start_x - scope_line.offset, scope_line.start_y), Vector2.new(scope_line.start_x - scope_line.offset - scope_line.length, scope_line.start_y + scope_line.width), scope_line.col_1, scope_line.col_2, scope_line.col_1, scope_line.col_2)

    --Right
    Render.GradientBoxFilled(Vector2.new(scope_line.start_x + scope_line.offset, scope_line.start_y), Vector2.new(scope_line.start_x + scope_line.offset + scope_line.length, scope_line.start_y + scope_line.width), scope_line.col_1, scope_line.col_2, scope_line.col_1, scope_line.col_2)

    --Up
    Render.GradientBoxFilled(Vector2.new(scope_line.start_x, scope_line.start_y + scope_line.offset), Vector2.new(scope_line.start_x + scope_line.width, scope_line.start_y + scope_line.offset + scope_line.length), scope_line.col_1, scope_line.col_1, scope_line.col_2, scope_line.col_2)

    --Down
    Render.GradientBoxFilled(Vector2.new(scope_line.start_x, scope_line.start_y - scope_line.offset), Vector2.new(scope_line.start_x + scope_line.width, scope_line.start_y - scope_line.offset - scope_line.length), scope_line.col_1, scope_line.col_1, scope_line.col_2, scope_line.col_2)
end

scope_line.on_destroy = function()
    scope_line.var:SetInt(scope_line.ref)
end

Cheat.RegisterCallback("draw", scope_line.on_draw)
Cheat.RegisterCallback("destroy", scope_line.on_destroy)
Пожалуйста, авторизуйтесь для просмотра ссылки.
топи тапи топи
 
Privatny p100 DT Airlag Break LC Teleport Exploit
Участник
Статус
Оффлайн
Регистрация
27 Янв 2021
Сообщения
982
Реакции[?]
154
Поинты[?]
77K
Почему у меня изза него индикаторы не работают, я в одну луашку их запихнул
 
Олдфаг
Статус
Оффлайн
Регистрация
28 Дек 2018
Сообщения
2,585
Реакции[?]
1,436
Поинты[?]
2K
life is cheap, death is free!
Эксперт
Статус
Оффлайн
Регистрация
9 Дек 2019
Сообщения
1,602
Реакции[?]
513
Поинты[?]
2K
Скрипт афигенный, спору нет, но меня как перфекциониста задушило одно
Левая и верхняя отдалены на пиксель
комменты где верхнее и нижнее так же перепутаны
если вы такой же перфекционист как и я то вот:

Код:
local scope_line = {}

scope_line.var = Menu.FindVar("Visuals", "View", "Camera", "Remove Scope")
scope_line.screen = EngineClient:GetScreenSize()
scope_line.ref = scope_line.var:GetInt()

scope_line.menu = {}

scope_line.menu.offset = Menu.SliderInt("Custom Scope", "Offset", 10, 0, 500)
scope_line.menu.length = Menu.SliderInt("Custom Scope", "Length", 60, 0, 1000)
scope_line.menu.anim_speed = Menu.SliderInt("Custom Scope", "Anim Speed", 15, 1, 30)
scope_line.menu.col_1 = Menu.ColorEdit("Custom Scope", "Color 1", Color.RGBA(255, 255, 255))
scope_line.menu.col_2 = Menu.ColorEdit("Custom Scope", "Color 2", Color.RGBA(255, 255, 255, 0))

scope_line.anim_num = 0

scope_line.lerp = function(a, b, t)
    return a + (b - a) * t
end

scope_line.on_draw = function()
    scope_line.var:SetInt(2)

    local_player = EntityList.GetLocalPlayer()
    scope_line.anim_speed = scope_line.menu.anim_speed:Get()

    if not local_player or not local_player:IsAlive() or not local_player:GetProp("m_bIsScoped") then
        scope_line.anim_num = scope_line.lerp(scope_line.anim_num, 0, scope_line.anim_speed * GlobalVars.frametime)
    else
        scope_line.anim_num = scope_line.lerp(scope_line.anim_num, 1, scope_line.anim_speed * GlobalVars.frametime)
    end

    scope_line.offset = scope_line.menu.offset:Get() * scope_line.anim_num
    scope_line.length = scope_line.menu.length:Get() * scope_line.anim_num
    scope_line.col_1 = scope_line.menu.col_1:Get()
    scope_line.col_2 = scope_line.menu.col_2:Get()
    scope_line.width = 1

    scope_line.col_1.a = scope_line.col_1.a * scope_line.anim_num
    scope_line.col_2.a = scope_line.col_2.a * scope_line.anim_num
    
    scope_line.start_x = scope_line.screen.x / 2
    scope_line.start_y = scope_line.screen.y / 2

    --Left
    Render.GradientBoxFilled(Vector2.new(scope_line.start_x - scope_line.offset + 1, scope_line.start_y), Vector2.new(scope_line.start_x - scope_line.offset - scope_line.length + 1, scope_line.start_y + scope_line.width), scope_line.col_1, scope_line.col_2, scope_line.col_1, scope_line.col_2)

    --Right
    Render.GradientBoxFilled(Vector2.new(scope_line.start_x + scope_line.offset, scope_line.start_y), Vector2.new(scope_line.start_x + scope_line.offset + scope_line.length, scope_line.start_y + scope_line.width), scope_line.col_1, scope_line.col_2, scope_line.col_1, scope_line.col_2)

    --Down
    Render.GradientBoxFilled(Vector2.new(scope_line.start_x, scope_line.start_y + scope_line.offset), Vector2.new(scope_line.start_x + scope_line.width, scope_line.start_y + scope_line.offset + scope_line.length), scope_line.col_1, scope_line.col_1, scope_line.col_2, scope_line.col_2)

    --Up
    Render.GradientBoxFilled(Vector2.new(scope_line.start_x, scope_line.start_y - scope_line.offset + 1), Vector2.new(scope_line.start_x + scope_line.width, scope_line.start_y - scope_line.offset - scope_line.length + 1), scope_line.col_1, scope_line.col_1, scope_line.col_2, scope_line.col_2)
end

scope_line.on_destroy = function()
    scope_line.var:SetInt(scope_line.ref)
end

Cheat.RegisterCallback("draw", scope_line.on_draw)
Cheat.RegisterCallback("destroy", scope_line.on_destroy)
 
Дизайнер
Статус
Оффлайн
Регистрация
18 Авг 2017
Сообщения
1,924
Реакции[?]
2,245
Поинты[?]
146K
Товары в продаже
1
Скрипт афигенный, спору нет, но меня как перфекциониста задушило одно
Левая и верхняя отдалены на пиксель
комменты где верхнее и нижнее так же перепутаны
если вы такой же перфекционист как и я то вот:

Код:
local scope_line = {}

scope_line.var = Menu.FindVar("Visuals", "View", "Camera", "Remove Scope")
scope_line.screen = EngineClient:GetScreenSize()
scope_line.ref = scope_line.var:GetInt()

scope_line.menu = {}

scope_line.menu.offset = Menu.SliderInt("Custom Scope", "Offset", 10, 0, 500)
scope_line.menu.length = Menu.SliderInt("Custom Scope", "Length", 60, 0, 1000)
scope_line.menu.anim_speed = Menu.SliderInt("Custom Scope", "Anim Speed", 15, 1, 30)
scope_line.menu.col_1 = Menu.ColorEdit("Custom Scope", "Color 1", Color.RGBA(255, 255, 255))
scope_line.menu.col_2 = Menu.ColorEdit("Custom Scope", "Color 2", Color.RGBA(255, 255, 255, 0))

scope_line.anim_num = 0

scope_line.lerp = function(a, b, t)
    return a + (b - a) * t
end

scope_line.on_draw = function()
    scope_line.var:SetInt(2)

    local_player = EntityList.GetLocalPlayer()
    scope_line.anim_speed = scope_line.menu.anim_speed:Get()

    if not local_player or not local_player:IsAlive() or not local_player:GetProp("m_bIsScoped") then
        scope_line.anim_num = scope_line.lerp(scope_line.anim_num, 0, scope_line.anim_speed * GlobalVars.frametime)
    else
        scope_line.anim_num = scope_line.lerp(scope_line.anim_num, 1, scope_line.anim_speed * GlobalVars.frametime)
    end

    scope_line.offset = scope_line.menu.offset:Get() * scope_line.anim_num
    scope_line.length = scope_line.menu.length:Get() * scope_line.anim_num
    scope_line.col_1 = scope_line.menu.col_1:Get()
    scope_line.col_2 = scope_line.menu.col_2:Get()
    scope_line.width = 1

    scope_line.col_1.a = scope_line.col_1.a * scope_line.anim_num
    scope_line.col_2.a = scope_line.col_2.a * scope_line.anim_num
   
    scope_line.start_x = scope_line.screen.x / 2
    scope_line.start_y = scope_line.screen.y / 2

    --Left
    Render.GradientBoxFilled(Vector2.new(scope_line.start_x - scope_line.offset + 1, scope_line.start_y), Vector2.new(scope_line.start_x - scope_line.offset - scope_line.length + 1, scope_line.start_y + scope_line.width), scope_line.col_1, scope_line.col_2, scope_line.col_1, scope_line.col_2)

    --Right
    Render.GradientBoxFilled(Vector2.new(scope_line.start_x + scope_line.offset, scope_line.start_y), Vector2.new(scope_line.start_x + scope_line.offset + scope_line.length, scope_line.start_y + scope_line.width), scope_line.col_1, scope_line.col_2, scope_line.col_1, scope_line.col_2)

    --Down
    Render.GradientBoxFilled(Vector2.new(scope_line.start_x, scope_line.start_y + scope_line.offset), Vector2.new(scope_line.start_x + scope_line.width, scope_line.start_y + scope_line.offset + scope_line.length), scope_line.col_1, scope_line.col_1, scope_line.col_2, scope_line.col_2)

    --Up
    Render.GradientBoxFilled(Vector2.new(scope_line.start_x, scope_line.start_y - scope_line.offset + 1), Vector2.new(scope_line.start_x + scope_line.width, scope_line.start_y - scope_line.offset - scope_line.length + 1), scope_line.col_1, scope_line.col_1, scope_line.col_2, scope_line.col_2)
end

scope_line.on_destroy = function()
    scope_line.var:SetInt(scope_line.ref)
end

Cheat.RegisterCallback("draw", scope_line.on_draw)
Cheat.RegisterCallback("destroy", scope_line.on_destroy)
почему ты self не используешь :FeelsBadMan:
 
Начинающий
Статус
Оффлайн
Регистрация
16 Июн 2021
Сообщения
33
Реакции[?]
7
Поинты[?]
0
почему ты self не используешь :FeelsBadMan:
можно ещё проще.
Код:
class = {}
class.test_str = "hello"
class.test_fn = function(s)
    print(s.hello)
end
registercallback("paint", function class:test_fn() end )
или ещё проще
Код:
class = {}
class.test_str = "hello"
class.test_fn = function()
    s = class
    print(s.hello)
end
registercallback("paint", class.test_fn )
 
Последнее редактирование:
Сверху Снизу