ID:177276
 
I don't exactly understand how prob() works. Here is what I have:
if(prob(30))
M.l=1
src << "You score!"
else
M.l=0
src << "Denied!"

I get messed up results though. If prob(30)==0 then it will do the else like its supposed to, but if prob(30)==1 then it will do both. Maybe I am using it wrong, if someone could help I would be really grateful.

Canar
if(prob(30))//that means it has a 30% chance it will work

The number inside the proc is the percent chance for it to work; the higher the number the more likely it will happen.

You used it right from what I see.
In response to Super16
hmm... I knew that it was the percent, I read the info in the help. but I think I must have used it wrong in my proc. it always runs the else command. thanks anyway super.

Canar
In response to Canar
It may run the else because your probability leans more on the else statement. My test worked fine,

mob/verb/LALA()
if(prob(30))
world << "if worked."
else
world << "else worked."