Reply to Re: Random function: Helpo-pleaso
If you don't have an account, just leave the password field blank.
In slayer's die procedure:
int &rand = random(15, 1);
if (&rand == 1)
//^doesn't have to be 1, anything up to 15.
{
//make potion
}
Following attached to screen (or a sprite):
void main (void)
{
int &rand = random(22, 1);
if (&rand <= 3)
{
&rand = random(3, 1);
if (&rand >= 2)
{
if (&rand == 3)
{
//create 1 bonca here
}
//create 1 bonca here
}
//create 1 bonca here
}
kill_this_task();
}
I think this is what you meant? So there is a 19 in 22 chance of there being no boncas.
Edit: The line &rand = random(3, 1); is unecessary, take it out if you like.
int &rand = random(15, 1);
if (&rand == 1)
//^doesn't have to be 1, anything up to 15.
{
//make potion
}
Following attached to screen (or a sprite):
void main (void)
{
int &rand = random(22, 1);
if (&rand <= 3)
{
&rand = random(3, 1);
if (&rand >= 2)
{
if (&rand == 3)
{
//create 1 bonca here
}
//create 1 bonca here
}
//create 1 bonca here
}
kill_this_task();
}
I think this is what you meant? So there is a 19 in 22 chance of there being no boncas.
Edit: The line &rand = random(3, 1); is unecessary, take it out if you like.







