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

Random monster loot?

Hey, I was wondering how can I make it so a monster drops random loot. i.e drops a bone 100%, gold 10%, sword 60% something like that. thank you in advance

1 answer

✓ Accepted answer

You would want to make use of the math.random function.

For example, if you wanted to make gold drop with a 10% chance, you could use the following:

-- If the random number is between 1 and 10, then:
if math.random(1, 100) <= 10 then
	-- drop gold
end

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