how to add a random chance?

im making a archery game where you shoot arrows at a target…
the arrows are kinds [again]

i found th file of random chances… it works well sort of didnt try it but it loaded…
but i can’t use otherwise unless i use if…

instead of shooting the arrow  when a random chance of 15 in 100 succeeds:

so how can i use otherwise with this

instead of shooting the arrow when a random chance of 15 in 100 succeeds: say "you grip the bow and pull back the arrow with careful aim. the arrow fires"; now the noun is on the target; say "the arrow was on target"; otherwise: say "you missed"

but it seems otherwise doesnt work with anything but if…

Just put the “if a random chance succeeds” in the body of the rule:

instead of shooting the arrow: say "you grip the bow and pull back the arrow with careful aim. the arrow fires"; if a random chance of 15 in 100 succeeds: now the noun is on the target; say "the arrow was on target"; otherwise: say "you missed".

For this, I think you’ll need the indentation exactly as it is or Inform won’t know what’s under “if” and what’s under “otherwise.”

it showed:
The phrase or rule definition ‘instead of shooting the arrow’ is written using the ‘colon and indentation’ syntax for its 'if’s, 'repeat’s and 'while’s, where blocks of phrases grouped together are indented one tab step inward from the ‘if …:’ or similar phrase to which they belong. But the tabs here seem to be misaligned, and I can’t determine the structure. The first phrase going awry in the definition seems to be ‘say “you grip the bow and pull back the […] with careful aim. the arrow fires”’ , in case that helps.

Did you copy and paste it from the forum? Sometimes Inform doesn’t like that. Try deleting all the whitespace and re-indenting it yourself and see if that helps?

Oh, that’s odd. It looks like it turned the tabs into spaces.

One trick for getting the indentation when this happens is to quote the original post, copy the code from the post that shows up, and then cancel your reply. In this case that will get you the original indentation.