Problem with random() command
I have a problem with random() command that i added to this script:
void main(void)
{
int &myrand = random(5, 1);
}
void talk(void)
{
if (&myrand == 1)
{
say_Stop("`4Weeeee.", ¤t_sprite);
}
if (&myrand == 2)
{
say_stop("`4Nice stars.Hehehe", ¤t_sprite);
}
if (&myrand == 3)
{
say_stop("`4Is that my bug on the beer?", ¤t_sprite);
}
if (&myrand == 4)
{
say_stop("Are you my wife?", ¤t_sprite);
}
}
When i talk to him hes saying only in if (&myrand == 2) others not.What should i do?
void main(void)
{
int &myrand = random(5, 1);
}
void talk(void)
{
if (&myrand == 1)
{
say_Stop("`4Weeeee.", ¤t_sprite);
}
if (&myrand == 2)
{
say_stop("`4Nice stars.Hehehe", ¤t_sprite);
}
if (&myrand == 3)
{
say_stop("`4Is that my bug on the beer?", ¤t_sprite);
}
if (&myrand == 4)
{
say_stop("Are you my wife?", ¤t_sprite);
}
}
When i talk to him hes saying only in if (&myrand == 2) others not.What should i do?
What you are doing right now is randomizing his speech once you enter the screen. Put int &myrand = random(5, 1); near the top of the talk void's contents rather than in void main(), and his text should randomize every time you talk to him.







