Creating Probabilities

Hello!
I'm planning a couple of games where probabilities might come into play. Say you're making Oregon Trail, and you want at any given time for there to be a 5% chance for game.attribute "dysentery" to be true, otherwise false (on a timer or whatnot). Or as another example, you're making an RPG, and you want to create a "chance to miss" with every enemy attack. Would I have to create a game attribute using random(0,100), then change dysentery to true if game attribute < 5?
I've tried looking in the forums for this, and haven't found anything. I'm not really sure what the most efficient way of doing this would be. Thanks!
I'm planning a couple of games where probabilities might come into play. Say you're making Oregon Trail, and you want at any given time for there to be a 5% chance for game.attribute "dysentery" to be true, otherwise false (on a timer or whatnot). Or as another example, you're making an RPG, and you want to create a "chance to miss" with every enemy attack. Would I have to create a game attribute using random(0,100), then change dysentery to true if game attribute < 5?
I've tried looking in the forums for this, and haven't found anything. I'm not really sure what the most efficient way of doing this would be. Thanks!
Comments
Christ, that just sounded wrong...
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Christ, that just sounded wrong...
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Christ, that just sounded wrong...
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io