local modname = minetest.get_current_modname() function blockgame.chance (chance) return math.random(1, chance) == 1 end function blockgame.random_element (tab) local keys = blockgame.get_keys(tab) return tab[keys[math.random(1, #keys)]] end