2023-10-11 07:17:21 +00:00
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
|
2023-10-11 17:12:47 +00:00
|
|
|
function blockgame.chance (chance)
|
2023-10-13 11:03:20 +00:00
|
|
|
return math.random(1, chance) == 1
|
2023-10-11 07:17:21 +00:00
|
|
|
end
|
2023-10-12 09:07:27 +00:00
|
|
|
|
|
|
|
function blockgame.random_element (tab)
|
|
|
|
local keys = blockgame.get_keys(tab)
|
2023-10-13 11:03:20 +00:00
|
|
|
return tab[keys[math.random(1, #keys)]]
|
2023-10-12 09:07:27 +00:00
|
|
|
end
|