Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I'm making an rng game (like sol's rng on roblox) and my rng is very innefficient.
- ScratchSupremer
- Scratcher
6 posts
I'm making an rng game (like sol's rng on roblox) and my rng is very innefficient.
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.
forever
set pen color to (imagination)
end
- -TUB-
- Scratcher
100+ posts
I'm making an rng game (like sol's rng on roblox) and my rng is very innefficient.
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
- ScratchSupremer
- Scratcher
6 posts
I'm making an rng game (like sol's rng on roblox) and my rng is very innefficient.
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
forever
set pen color to (imagination)
end
- ScratchSupremer
- Scratcher
6 posts
I'm making an rng game (like sol's rng on roblox) and my rng is very innefficient.
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
forever
set pen color to (imagination)
end
- Discussion Forums
- » Help with Scripts
- » I'm making an rng game (like sol's rng on roblox) and my rng is very innefficient.