ID:157314
 
I'm sure this has been asked plenty of times but I can't seem to find anything on it. I'm creating a game where you encounter enemies in the grass and there's a random chance of encountering them. I have a formula for that, which is 1 in (187.5/Rarity). How could I program that? I have the area programmed and I know how to use Entered() and Exited() but after that I'm a bit lost.
if(prob(formula))
In response to Emasym
For some reason, if(prob(1 in (187.5/10))) doesn't seem to work at all. Am I doing something wrong?
In response to DisturbedSixx
"in" is used to specify a list of things, it's not used in your way of things.

Like this:
for(var/mob/M in view())
//
input(src,"Select something") in ("Yes","No")


What you need is

if(prob(5.33))
//1 every 18.75 equals 5,333... probability