I'm making an rng game (like sol's rng on roblox) and my rng is very innefficient.

id: 753068

category: Help with Scripts

posts: 4

I need to find a way to find a way to make the rng just more efficient. The way i use right now is
when green flag clicked
repeat (2)
add [rare] to [chance]
end
repeat (4)
add [common] to [chance]
end
Etc, etc.
But, since there's so many rarities and a cap of 400000 items on lists, it just is too inefficient.
-TUB- -TUB- loading
You can do this:
set [rand v] to (pick random (0.0) to (1.0))
if <(rand) < (legendaryChance)> then
set [result v] to [legendary]
else
if <(rand) < (epicChance)> then
set [result v] to [epic]
else
if <(rand) < (rareChance)> then
set [result v] to [rare]
else
set [result v] to [common]
end
end
end

-TUB- wrote:

You can do this:
set [rand v] to (pick random (0.0) to (1.0))
if <(rand) < (legendaryChance)> then
set [result v] to [legendary]
else
if <(rand) < (epicChance)> then
set [result v] to [epic]
else
if <(rand) < (rareChance)> then
set [result v] to [rare]
else
set [result v] to [common]
end
end
end
Okay! I'll try this.

ScratchSupremer wrote:

-TUB- wrote:

You can do this:
set [rand v] to (pick random (0.0) to (1.0))
if <(rand) < (legendaryChance)> then
set [result v] to [legendary]
else
if <(rand) < (epicChance)> then
set [result v] to [epic]
else
if <(rand) < (rareChance)> then
set [result v] to [rare]
else
set [result v] to [common]
end
end
end
Okay! I'll try this.
It works but the numbers are really rigged.