Вопрос Функция если

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
4 Июл 2022
Сообщения
7
Реакции
0
как сделать функцию ,которая проверяет скоуп на локал плеере и если он прицелен ,то что-то происходит
 
смотря где
 
берешь нетвар на открыт ли скоп потом получаешь локалплеера. Потом пишешь если включена функция(бул) и локальный игрок -> в скопе потом(зен) делаешь что тебе надо и в конце енд. Вызываешь все в креативмуве
 
как сделать функцию ,которая проверяет скоуп на локал плеере и если он прицелен ,то что-то происходит
code_language.lua:
Expand Collapse Copy
local localplayer = entity.get_local_player() --Здесь может быть и не локальный игрок
if localplayer.m_bIsScoped then
    --do some code
end
 
а если функцию()
code_language.lua:
Expand Collapse Copy
function is_scoped(player)
    local entity = player or entity.get_local_player()
   
    return entity.m_bIsScoped
end

для локального игрока вызывать так:
is_scoped()
для других игроков так:
is_scoped(player)
 
code_language.lua:
Expand Collapse Copy
function is_scoped(player)
    local entity = player or entity.get_local_player()
  
    return entity.m_bIsScoped
end

для локального игрока вызывать так:
is_scoped()
для других игроков так:
is_scoped(player)
блин ,а как тут сделать так ,чтобы когда скопился Pos x менялся на x/2 + 23

function DrawIndicators() if (not Menu["Indicators"].Enable:get()) then return end local Pos = { X = render.screen_size().x/2, Y = render.screen_size().y/2 + 13 }; local Condition = YandereConditions["Priority"]; IndicatorsGradient["Logo"]:set_colors({ Menu["Indicators"].Color1:get(), Menu["Indicators"].Color2:get() }); IndicatorsGradient["Conditions"]:set_colors({ Menu["Indicators"].Color1:get(), Menu["Indicators"].Color2:get() }); IndicatorsGradient["Conditions"]:set_text(IndicatorsConditions[Condition]); render.text(2, vector(Pos.X, Pos.Y), color(255, 255, 255, 255), "c", IndicatorsGradient["Logo"]:get_animated_text()); render.text(2, vector(Pos.X, Pos.Y + 8), color(255, 255, 255, 255), "c", IndicatorsGradient["Conditions"]:get_animated_text()); IndicatorsGradient["Logo"]:animate(); IndicatorsGradient["Conditions"]:animate(); end
 
блин ,а как тут сделать так ,чтобы когда скопился Pos x менялся на x/2 + 23

function DrawIndicators() if (not Menu["Indicators"].Enable:get()) then return end local Pos = { X = render.screen_size().x/2, Y = render.screen_size().y/2 + 13 }; local Condition = YandereConditions["Priority"]; IndicatorsGradient["Logo"]:set_colors({ Menu["Indicators"].Color1:get(), Menu["Indicators"].Color2:get() }); IndicatorsGradient["Conditions"]:set_colors({ Menu["Indicators"].Color1:get(), Menu["Indicators"].Color2:get() }); IndicatorsGradient["Conditions"]:set_text(IndicatorsConditions[Condition]); render.text(2, vector(Pos.X, Pos.Y), color(255, 255, 255, 255), "c", IndicatorsGradient["Logo"]:get_animated_text()); render.text(2, vector(Pos.X, Pos.Y + 8), color(255, 255, 255, 255), "c", IndicatorsGradient["Conditions"]:get_animated_text()); IndicatorsGradient["Logo"]:animate(); IndicatorsGradient["Conditions"]:animate(); end
ты че охуел

Код:
Expand Collapse Copy
if is_scoped(player)
   x = x/2 + 23
 
Назад
Сверху Снизу