local ores = {
["Dirt"] = 8.5,
["Stone"] = 6.5,
["Coal"] = 5,
["Tin"] = 4.2,
["Silver"] = 3.5,
["Gold"] = 2.3,
["Platinum"] = 1.4,
["Diamond"] = 0.7,
["Opal"] = 0.4,
["Obsidian"] = 0.1,
}
repeat
local Weight = 0
for _, Chance in pairs(ores) do
Weight = (Chance * 10)
end
local ranNum = math.random(1, Weight)
Weight = 0
for Prize, Chance in pairs(ores) do
Weight = (Chance * 10)
if Weight >= ranNum then
print("You Mined Into "..Prize.." With %"..Weight.." Chance")
end
end
until false
To embed this project on your website, copy the following code and paste it into your website's HTML: