Проблема с условиями

Dmitriy Makarov

25.05.2021
Автор темы
Проверенный
2,478
1,113
Версия MoonLoader
.026-beta
Есть 2 цвета:
1) 4294927974
2) 301989887
Нужно сделать так:
Lua:
if result and isKeyJustPressed(VK_R)
1 условие) Если result и нажата клавиша R и color равно 4294927974 или 301989887, then
2 условие) elseif result и нажата клавиша R и color НЕ РАВНО 4294927974 или 301989887, then
Пробовал так:
Lua:
-- 1 условие
if result and isKeyJustPressed(VK_R) and color == 4294927974 and 301989887 then
if result and isKeyJustPressed(VK_R) and color == 4294927974 or 301989887 then
-- 2 условие
if result and isKeyJustPressed(VK_R) and color ~= 4294927974 and 301989887 then
if result and isKeyJustPressed(VK_R) and color ~= 4294927974 or 301989887 then
При срабатывании result без нажатия на R флудило в чат
 
Решение
Если я всё правильно понял, то как-то так
Lua:
if result and isKeyJustPressed(VK_R) and (color == 4294927974 or color == 301989887) then -- 1е условие
    -- действие
end

if result and isKeyJustPressed(VK_R) and (color ~= 4294927974 or color ~= 301989887) then -- 2е условие
    -- действие
end

wojciech?

Известный
204
115
Если я всё правильно понял, то как-то так
Lua:
if result and isKeyJustPressed(VK_R) and (color == 4294927974 or color == 301989887) then -- 1е условие
    -- действие
end

if result and isKeyJustPressed(VK_R) and (color ~= 4294927974 or color ~= 301989887) then -- 2е условие
    -- действие
end