because 'wait' doesn't pause/halt the 'while' looping, thus, you get a second activated 'wait' at the same time the first 'wait' is waiting for the person to press a key, which (having two 'waits' at the same time) can't occur, thus the error.
quest doesn't have a good 'while-looping' programmed system, epsecially with it usually being so reliant upon user inputs or popup windows (as these are useful functions for game makers to use).
just use recursion looping instead, but just make sure you don't allow it to build up, obviously.
recursion looping:
<function name="whatever_function">
if (game.mode < 3) {
wait {
msg ("Coucou!")
game.mode = game.mode + 1
whatever_function // putting this here, so you don't have an infinite loop, but you can adjust this entire code for what you want to do
}
}
</function>
if you want to see more examples of recursion looping:
viewtopic.php?f=18&t=4988--------------
if you need to use 'get input', 'show menu', and/or 'wait', then you can't use 'while' and general looping. You must use recursion looping and 'if' Scripts.
Otherwise, you can use 'while' and general looping. However, (in my ignorance), I've not come across many times where you'd need to apply 'while' and generalized looping.