Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How does probability work? I'm having a problem doing that.

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

1 answer

✓ Accepted answer

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

2 comments

0

Thanks!

0

if you need and more help understanding feel free to ask

This discussion is preserved as it was. New answers, comments, and votes are closed.