ID:178217
 
mob/proc/Attack(mob/attacker,mob/defender)
var/damage = (attacker.precision - defender.protection)/(attacker.precision + defender.protection)
var/aim = (attacker.precision/defender.swiftness)*100
prob(aim)
world << "[damage] is damage!"


What I'm trying to do is make it so that there is a chance of hitting depending on the aim. I havn't used prob() ever, so I don't know. Thanks for reading.

-ST
prob(num) actually does something like this.
It creates a number from rand(1,100). Then if the number is less then or equal to num then it returns 1. It should be used in an if statement.