Thanks.
Edited by Zpace, 21 March 2008 - 04:35 PM.
Posted 21 March 2008 - 04:30 PM
Edited by Zpace, 21 March 2008 - 04:35 PM.
Posted 21 March 2008 - 04:37 PM
variable=random(number of sides);
if variable=1
{
Actions
}
Posted 21 March 2008 - 04:41 PM
variable=random(number of sides);
if variable=1
{
Actions
}Posted 21 March 2008 - 04:42 PM
{
myvar = floor(random(2));
switch(myvar){
case 0:
show_message("myvar = 0");
break;
case 1:
show_message("myvar = 1");
}
}Remember to add the break; after every case. You don't have to add it in the last one.Edited by FireWire Games, 21 March 2008 - 04:43 PM.
Posted 21 March 2008 - 04:50 PM
Edited by GMREC1111, 21 March 2008 - 04:50 PM.
Posted 21 March 2008 - 05:07 PM
Try using the switch functions. They can make your life a lot easier:
{ myvar = floor(random(2)); switch(myvar){ case 0: show_message("myvar = 0"); break; case 1: show_message("myvar = 1"); } }Remember to add the break; after every case. You don't have to add it in the last one.
~FireWire Games
@ Zpace
...do what FireWire said...his makes sure the number is NOT a decimal...and it truly makes life easier!
Posted 21 March 2008 - 05:08 PM
Posted 21 March 2008 - 05:09 PM
Edited by GMREC1111, 21 March 2008 - 05:12 PM.
Posted 21 March 2008 - 05:16 PM
0 members, 0 guests, 0 anonymous users