Is my use of the Random thing correct?

Started by highkingtorygg, Mon 14/09/2015 20:50:45

Previous topic - Next topic

highkingtorygg

Will this work?

Code: ags

function room_FirstLoad()
{
if(Random(1)== 0)
{
  Display("words");
}
else{
  Display("other words");
}
}

Snarky


Monsieur OUXX

FirstLoad is called only at first load. So what you did will cause the player to say either "words" or "other words" the FIRST TIME he enters the room. Not the subsequent times.
 

Khris

If a 50/50 chance was your intention, then yes, you used Random() correctly.

SMF spam blocked by CleanTalk