Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Piece:_random(gem_table)
- local rand_table = {}
- local num = 0
- for color, freq in pairs(gem_table) do
- for i = 1, freq do
- num = num + 1
- rand_table[num] = color
- end
- end
- local rand = rng.random(num)
- return rand_table[rand]
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement