Breaking Cuffs [with a 10 % chance]
#1

Hey everyone, i have a command, to break cuffs, if a player is cuffed, and i want that the player only has a 10 % chance of breaking it
Reply
#2

pawn Код:
if ( random ( 100 ) <= 10 ) {
   
    // success
}

else {

    // fail
}
Reply
#3

Thanks! That worked. Rep
Reply
#4

random(100) goes from 0 to 99.
So the correct thing would be the following:
Код:
if ( random ( 100 ) < 10 )
...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)