Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Math and shit for randomly selecting the rarity
- local r = math.random(1, 100)
- local rarity
- for i=1,#sws.rarity do
- //If the rarity has no chance assigned, skip that raity.
- if not sws.rarity[i].chance then continue end
- //Checks the random number to the raritys chance.
- if r >= 1 and r <= sws.rarity[i].chance then
- //If it passes, set the rarity and break the loop.
- rarity = i
- break
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement