cincalok Posted June 15, 2016 Posted June 15, 2016 Hi all, I am currently working on tr0n's questboard. I have tried to edit the script to make the monsters to be random instead. Specific lines are as below: setarray .MHuntArray[0],1031,1002,1400,1863; set .MHuntMob,.MHuntArray[rand(getarraysize(.MHuntArray))]; AddHunting("Test",1,99,1234,1,0,0,0,.MHuntMob,10); However, it doesn't seem to random it. It only randoms if i @reloadscript Full script as below: http://upaste.me/09a32717014d73d09 Appreciate if anyone can give me an advice or two on this. Thank you. setarray .MHuntArray[0],1031,1002,1400,1863; set .MHuntMob,.MHuntArray[rand(getarraysize(.MHuntArray))]; AddHunting("Test",1,99,1234,1,0,0,0,.MHuntMob,10); Quote
0 Stolao Posted June 15, 2016 Posted June 15, 2016 That's because it under the OnInit label which is only run on script loading, be to make it random you would need to move that up in the script where a player triggers it. Quote
0 cincalok Posted June 16, 2016 Author Posted June 16, 2016 That's because it under the OnInit label which is only run on script loading, be to make it random you would need to move that up in the script where a player triggers it. Hi Stolao, I did as you said actually before this, putting setarray .MHuntArray[0],1031,1002,1400,1863; set .MHuntMob,.MHuntArray[rand(getarraysize(.MHuntArray))]; right after the script starts. But it seems .MHuntMob is unable to capture the value in AddHunting function that way Appreciate if you could advise me further. Thanks in advance. Quote
Question
cincalok
Hi all,
I am currently working on tr0n's questboard.
I have tried to edit the script to make the monsters to be random instead.
Specific lines are as below:
However, it doesn't seem to random it. It only randoms if i @reloadscript
Full script as below:
http://upaste.me/09a32717014d73d09
Appreciate if anyone can give me an advice or two on this.
Thank you.
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.