Вопрос Стейты

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
12 Фев 2021
Сообщения
123
Реакции
21
Добрый день, форумчане. Возник вопрос. Как сделать билдер по стейтам, вернее как сделать сами проверки на стейт игрока.
Не кидайте код из кордов в которых есть мета таблицы и кфг системы или супер нереально умная логика менюшки и самого билдера. Все буду делать банально до безобразия. В опен сурсе такого к сожалению не нашел.
 
Добрый день, форумчане. Возник вопрос. Как сделать билдер по стейтам, вернее как сделать сами проверки на стейт игрока.
Не кидайте код из кордов в которых есть мета таблицы и кфг системы или супер нереально умная логика менюшки и самого билдера. Все буду делать банально до безобразия. В опен сурсе такого к сожалению не нашел.
Дальше думаю ты сам поймёшь...
Код:
Expand Collapse Copy
local CGetCurrentState = function(player)
    local State = 0
    if not player then return State end
    if not player:is_alive() then return State end
    if player:get_velocity() < 5 and player:on_ground() then State = 1 end -- Standing
    if player:get_velocity() > 5 and player:get_velocity() < 100 and player:on_ground() then State = 2 end -- Walking
    if player:get_velocity() > 100 and player:on_ground() then State = 3 end -- Running
    if player:duck_amount() > 0.1 and player:get_velocity() < 5 and player:on_ground() then State = 4 end -- Ducking
    if player:duck_amount() > 0.1 and player:get_velocity() > 5 and player:on_ground() then State = 5 end -- Moving in duck
    if not player:on_ground() then State = 6 end -- In air
    if not player:on_ground() and player:duck_amount() > 0.1 then State = 7 end -- Crouching in air
    return State
end
 
Дальше думаю ты сам поймёшь...
Код:
Expand Collapse Copy
local CGetCurrentState = function(player)
    local State = 0
    if not player then return State end
    if not player:is_alive() then return State end
    if player:get_velocity() < 5 and player:on_ground() then State = 1 end -- Standing
    if player:get_velocity() > 5 and player:get_velocity() < 100 and player:on_ground() then State = 2 end -- Walking
    if player:get_velocity() > 100 and player:on_ground() then State = 3 end -- Running
    if player:duck_amount() > 0.1 and player:get_velocity() < 5 and player:on_ground() then State = 4 end -- Ducking
    if player:duck_amount() > 0.1 and player:get_velocity() > 5 and player:on_ground() then State = 5 end -- Moving in duck
    if not player:on_ground() then State = 6 end -- In air
    if not player:on_ground() and player:duck_amount() > 0.1 then State = 7 end -- Crouching in air
    return State
end
благодарствую
 
@enQ хистерия статес???
1709204690973.png
 
Назад
Сверху Снизу