So I want to make a luck percentage of giving coins for every 10 minutes but I don't understand how to make the luck percentage and also I searched into many places but didn't found any I want to make the luck percentage like the pets but here it picks random coins value.
1 | 250 Coins - 95 % |
2 | 1000 Coins - 70 % |
3 | 2500 Coins - 50 % |
4 | 5000 Coins - 25 % |
5 | 10000 Coins - 5 % |
Please help me out and explain how you did it.
01 | while wait( 5 ) do --Every 5 seconds will give it a new number |
02 | local num = math.random( 1 , 100 ) --From 1 to 100 number will be chosen randomly |
03 | if num > 0 and num < = 30 then --if the number is greater then 0 but less then or equal to 30 then you get Common |
04 | print (num) |
05 | print ( "You get Common" ) |
06 | elseif num > 30 and num < = 60 then |
07 | print (num) |
08 | print ( "You get Uncommon" ) |
09 | elseif num > 60 and num < = 80 then |
10 | print (num) |
11 | print ( "You get Rare" ) |
12 | elseif num > 80 and num < = 90 then |
13 | print (num) |
14 | print ( "You get Epic" ) |
15 | elseif num > 90 and num = = 100 then |
16 | print (num) |
17 | print ( "You get Legendary" ) |
18 | end |
19 | end |
I am not the best explainer