i have struggle with this problem for 2 days , this is the scenario
i saw a girl surrounded by 5 man in the corner of the street, what should i do ?
(here's the options, 2 default option which available from beginning and 2 other options will unlocked when reach success rate needed)
help her
keep walking and ignore her
stay and look what happen later (need 5 success rate)
pick your machine gun and shoot them all (need 10 success rate)
<<set $randPoint to random(5)>>
Success: <<set $rate to 0>><span id="success-rate">$rate</span>
<<button "the button">>
<<if $randPoint eq 2 or 3>>
<<set $rate to 0>>
<<else>>
<<set $rate++>>
<</if>>
<</button>>
with this code , when pressed the button and if the random point reach 2 or 3 ... the success rate come back to zero but increasing with another number
hell even the success rate is doesnt even change a bit ... must be a bad coding i have.
anyone can help me about this ? thanks before. sorry for my bad english, not my mother language
Comments
1. To compare $randPoint to two numbers you need to do: 2. Changing the value of a previously displayed variable will not cause the displayed value to automatically update, you have to code the update yourself: 3. The random value assigned to $randPoint does not change, so the button will always either add one to $rate or set $rate to zero. If you want $randPoint to have new random value each time the button is clicked then you have to move the <<set>> inside the button's code.
Try the following:
thx for the quick replay and its works great
and for the last, how do i disable link when i using wiki link (correct me if im mistake about the name), just like this
or like this
then how to enable it ? sorry for too much request for this .. thanks before
but it seems i have another problem, how to add delay on the button so people cant forcing it by clicking it repeatedly , because its look so easy when people clicking the button with insane speeed LOL and i dont want that happen.
please give me advice, thanks before.