I want to make a randomizer that works from percentages for example 0.1% 49.9% 50% and that its 0.1% 49.9% 50% chance to get it
This is the code i got so far with the random percentages
game.ReplicatedStorage.Events.BuyingCase.OnClientEvent:Connect(function(Bought)
if Bought == true then
for i, C in pairs(Cases.Items:GetChildren()) do
local Percentages = C.Percent.Value
end
end
end)
I don’t think it’s possible to generate random percentages from a minimum value to a maximum one.
I dont think it matters either if you’d generate a random percentage because you can easily achieve that by just generating a random number and putting the percentage mark after it.
I suggest you do this:
local Random = math.random(0.0, 50.0)
local Percentage = Random.."%"
For a basic randomizer like that, consider using the Random function, which generates a number between 0 and 1.
Example: local Chance = math.random()
if Chance <= 0.5 then
print “It is less than or equal to 0.5”
else
print “It is greater than 0.5”
end