Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Trouble with random variables

11 years ago

So, I'm trying to make it so that there's a 1 in 20 chance that when a certain link is clicked, it will take you somewhere different that where it normally would. However, with everything I've tried, it just keeps setting the '1 in 20' page as the default page, and as a result you get taken there every time. I've read the guides on how random variables work and how to impliment them, but I'm still having a lot of trouble. Help?

Trouble with random variables

11 years ago

You'll need to post more info - like the Script you are using for example ...

---

That said, here's a guess at what might help you :

%RND := 1D20
IF %RND < 4 THEN
$DEST := @P100

So, the above rolls a d20, if the result is less than 4 (a 15% Chance), then it redirects the Link to page 100. If the above is not true, then it just goes to the Original Link Page.

Trouble with random variables

11 years ago

Thank you so much! Just tested it out, and that works perfectly :) Again, thanks!