For example, there's 10% chance that an egg will hatch a cat, and a 90% chance that it will be a dog. How do I do that?
Thanks
For example, there's 10% chance that an egg will hatch a cat, and a 90% chance that it will be a dog. How do I do that?
Thanks
use math .random like this
local rand=math.random(1,100)
if rand<=10 then
print("cat")
end
if rand >10 and rand<=100 then
print("dog")
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Thanks!
if you need and more help understanding feel free to ask