Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Diceroll Links

11 years ago
How do I make it so if someone clicks a link, they have a chance to go to one page or the other based on a percentage or ratio?

If the player clicks link on page 1, they have a 40% chance of going to page 2 and a 60% chance of going to page 3.

What would be the script? Where do I insert the script in order for it to work? Is it possible to do with the current script? Does chance/dicerolls/variables only work with items?

Diceroll Links

11 years ago

you would need a link script similar to this:

 

%CHANCE := 1D100

IF %CHANCE <= 40 THEN

$DEST := @P2 

ELSE

$DEST := @P3

 

with CHANCE being the name of a variable

Diceroll Links

11 years ago

Put this code on the link of page 1:

%ROLL := 1D100

IF %ROLL <= 40 THEN

BEGIN

$DEST := @P2

END

 

IF %ROLL > 40 THEN

BEGIN

$DEST := @P3

END

It works both with items, and links, so don't you worry. xD