random
Posted: Sun Aug 19, 2007 12:19 am
can any one tell me the code for random create actor?
d-soldier wrote:Slap this into the event you wish to do the creating, and fill in the blanks below.
int n;
n=rand(5);
if (n==0)
{
//insert create actor script here
}
if (n==1)
{
//insert create actor script here
}
if (n==2)
{
//insert create actor script here
}
if (n==3)
{
//insert create actor script here
}
if (n==4)
{
//insert create actor script here
}
tekdino wrote:can the 'int n' be used with the switch function? If yes, it would be shorter wouldn't it? I never adopted the switch code for some unknown reason.
int n=0;
switch(n)
{
case 1:
//stuff...
break;
case 2:
//more stuff...
break;
}