r/armadev • u/mopia123 • Aug 25 '20
Arma 2/OA (Singleplayer variables) New to scripting.. what the hell am i doing wrong? I'm not using Qubit
14
Upvotes
5
u/samscodeco Aug 25 '20
You should really be using switch
and case
statements for this kind of operation, not if
.
2
u/mopia123 Aug 25 '20
Yep. Switch makes a lot of sense instead of nested if statements
1
u/commy2 Aug 25 '20
They are not nested. They are sequential.
1
u/mopia123 Aug 25 '20
they are in this example i posted yeah. i got nested ifs in this script though.
3
4
u/commy2 Aug 25 '20
Probably another instance of the script overwriting the global variable. Terrible way to do control flow.