Hello.
I have this bit of code in my script:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">
_rNumber = floor(random 11);
if (_rNumber == 0) then (husLogic setPos (getPos hus1));
if (_rNumber == 1) then (husLogic setPos (getPos hus2));
if (_rNumber == 2) then (husLogic setPos (getPos hus3));
if (_rNumber == 3) then (husLogic setPos (getPos hus4));
if (_rNumber == 4) then (husLogic setPos (getPos hus5));
if (_rNumber == 5) then (husLogic setPos (getPos hus6));
if (_rNumber == 6) then (husLogic setPos (getPos hus7));
if (_rNumber == 7) then (husLogic setPos (getPos hus8));
if (_rNumber == 8) then (husLogic setPos (getPos hus9));
if (_rNumber == 9) then (husLogic setPos (getPos hus10));
if (_rNumber == 10) then (husLogic setPos (getPos hus11));
if (_rNumber == 11) then (husLogic setPos (getPos hus12));
[/QUOTE]
The code will will get a random number and depending on what it is execute the command... In this case a gameLogic that is to be moved to another gameLogics position.
But it always picks the last one... It always ends up at hus12. If I take the last row out, it will end up at the position of hus11.
How can I fix this? I guess my syntax is messed up.
Thx for any help!
HOME
Reply With Quote

