The Dink Network

Problem with random() command

July 9th 2007, 07:11 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
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.", &current_sprite);
}
if (&myrand == 2)
{
say_stop("`4Nice stars.Hehehe", &current_sprite);
}
if (&myrand == 3)
{
say_stop("`4Is that my bug on the beer?", &current_sprite);
}
if (&myrand == 4)
{
say_stop("Are you my wife?", &current_sprite);
}
}

When i talk to him hes saying only in if (&myrand == 2) others not.What should i do?
July 9th 2007, 07:18 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
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.
July 9th 2007, 07:22 AM
pq_cthunik.gif
GOKUSSJ6
Peasant He/Him Poland
Everyone should get a pizza for free in each week. 
Thanks