So I’m trying to make a game that tests your luck. To do that, I need to generate two numbers, if the number is one, the door stays open. But if the number is 2, the door slams in your face. The only problem is when the number is 2, the script just doesn’t work. Could anybody help me with this?
You have the comparison if ranNum == 2 then... nested inside of the other comparison, if ranNum == 1 then...
This makes the code under ranNum==2 never run as it can’t be equal to one and equal to two.
Make sure to end the first one before the second. So that it looks like:
if ranNum == 1 then
[...]
end
if ranNum == 2 theen
[...]
end
Or use an if/else-if or if/else, since there’s only two possibilities you could do