Guest Messenjah Posted September 9, 2013 Share Posted September 9, 2013 So, in Skyrim it is pretty simple. I'm just not sure how it works in Fallout:NV. What I need to do, is I need to write a script where the player can "win" a simple mini-game if he pays 5 caps to an activator. So, I need the game to select a random number between say 1 and 20 (Thus the player has a 5% chance of winning), and if the number is, lets say 11, they will get a win. Or, if we go 1-99, I could pick 5 random numbers that the player can win with as well if we want to get a bit more complicated. It doesn't really need to be very complex for what I'm doing. Just something very simple. Link to comment Share on other sites More sharing options...
jazzisparis Posted September 9, 2013 Share Posted September 9, 2013 The function GetRandomPercent will generate an integer between 0-99. So, to get a 5% chance, use: if GetRandomPercent < 5 Or: if GetRandomPercent > 94 Link to comment Share on other sites More sharing options...
Recommended Posts