How do I make RNG?

id: 749599

category: Help with Scripts

posts: 5

so when I click the button, it will show roll a random item, they all have their own rarity: 1 in 2, 1 in 4, 1 in 100k, 1 in 1m, etc.

and I'm confused on how to script it, can someone help me?
So like a poker machine roll type thing?


xavidoodleALT wrote:

So like a poker machine roll type thing?


pretty much, no. You only can roll 1 at a time and it all depends on ur luck and what you'll get.

It's pretty much like sol's rng in roblox
MakeGamsse MakeGamsse loading

Upauggfg12343nk wrote:

xavidoodleALT wrote:

So like a poker machine roll type thing?


pretty much, no. You only can roll 1 at a time and it all depends on ur luck and what you'll get.

It's pretty much like sol's rng in roblox
you can do PICK RANDOM 1 to (however many) and if its = 1 then make it do
but if its anything else then do pic krandom from however many for another roll e.g.
if its not that u can make more so yea
Eason_9 Eason_9 loading
You can do it with the pick random block:

<(pick random (1) to (10)) = (1) > // This will return "true" 1 in 10 times.
<(pick random (1) to ((100) / (10))) = (1)> // This will return "true" 10% of the times.

Basically, the code picks a random number and it will detect if its equal to one, which creates a system to detect rarity of things. So, for example:

if <(pick random (1) to (10)) = (1) > then
go to [ mouse pointer v]
end

The code above will let the sprite go to the mouse pointer 1 in 10 times.