Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do you make an Luck Percentage?

Asked by 3 years ago
Edited 3 years ago

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.

 250 Coins - 95%
1000 Coins - 70%
2500 Coins - 50%
5000 Coins - 25%
10000 Coins - 5%

Please help me out and explain how you did it.

1 answer

Log in to vote
1
Answered by 3 years ago
while wait(5) do--Every 5 seconds will give it a new number
    local num = math.random(1, 100)--From 1 to 100 number will be chosen randomly
    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
        print(num)
        print("You get Common")
    elseif num > 30 and num <= 60 then
        print(num)
        print("You get Uncommon")
    elseif num > 60 and num <= 80 then
        print(num)
        print("You get Rare")
    elseif num > 80 and num <= 90 then
        print(num)
        print("You get Epic")
    elseif num > 90 and num == 100 then
        print(num)
        print("You get Legendary")
    end
end

I am not the best explainer

Ad

Answer this question