Jump to content
Archosaurus

multiple statements after do

Recommended Posts

As I was typing this thread and triple checking that what I tried actually doesn't work, I came across the solution. Hah.

 

To make multiple statements happen after "do", you input it like this:
 
_cond = true; //Can be anything but I use this to loop
 
while {_cond} do {
[hint "guy has stopped"]
[doStop guy]
};
 
 
Statements must NOT be enclosed in {} nor should they be un-enclosed nor should they have ; after them.
 
while {x} do { [statement 1], [statement 2], [statement 3] };
 
This is the correct syntax.
 
Just posting this in case someone else has been tearing their hair out over this. It's really easy to make a typo in the correct syntax then never come back to it again.  :lol:
 
 
If you need an "if, then" then do this:
 
_cond = true;
 
while {_cond} do {
 
if (alive guy) then {
[hint "guy has stopped"]
[doStop guy]
};
};
 
 
I need to loop a script with an "if, then" and multiple statements, so that's how I figured this out. Tested and it should work.

Share this post


Link to post
Share on other sites
You can also do:

 



while {_cond} do
{
    if (alive guy) then
    {
        hint "guy has stopped";
        doStop guy;
    };
};


 

at except you mean something different.

 

 

PS: Please try to format code when you post it here, makes it easier to read.

Share this post


Link to post
Share on other sites

 

You can also do:
 
while {_cond} do
{
    if (alive guy) then
    {
        hint "guy has stopped";
        doStop guy;
    };
};
 
at except you mean something different.
 
 
PS: Please try to format code when you post it here, makes it easier to read.

 

I've been asking, but how exactly do I get the interface to input the code into so it can be formatted properly?

Share this post


Link to post
Share on other sites

It won't be formatted automatically (indentations etc) but you can use the syntax highlighting by using the <> button in the forums text editor.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×