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
Apr 7, 2024 19:45:06
I'm making an rng game (like sol's rng on roblox) and my rng is very innefficient.
view on scratch
view on legacy ocular
ScratchSupremer
loading
I need to find a way to find a way to make the rng just more efficient. The way i use right now is
But, since there's so many rarities and a cap of 400000 items on lists, it just is too inefficient.
when green flag clickedEtc, etc.
repeat (2)
add [rare] to [chance]
end
repeat (4)
add [common] to [chance]
end
But, since there's so many rarities and a cap of 400000 items on lists, it just is too inefficient.
Apr 7, 2024 20:09:12
I'm making an rng game (like sol's rng on roblox) and my rng is very innefficient.
view on scratch
view on legacy ocular
-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
Apr 8, 2024 00:21:06
I'm making an rng game (like sol's rng on roblox) and my rng is very innefficient.
view on scratch
view on legacy ocular
ScratchSupremer
loading
Okay! I'll try this. 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
Apr 8, 2024 13:45:02
I'm making an rng game (like sol's rng on roblox) and my rng is very innefficient.
view on scratch
view on legacy ocular
ScratchSupremer
loading
It works but the numbers are really rigged.Okay! I'll try this. 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