I've made this code
local value = 1
local val1 = 1
local val2 = 1
while true do
if value == 1 then
if val1 and val2 == 1 then
print("yes")
elseif value == 2 then
if val1 and val2 == 1 then
print("no")
end
end
end
wait(0.1)
end
when value = 1 it works fine, but when value = 2 it breaks and the elseif line doesn't recognize that the value = 2

2 comments
you realize the elseif is actually checking if this is false "val1 and val2 == true"
Put code in a code block for you