Need help with math.random error

So… I’m getting the same error as before for no reason. Even though i changed nothing of it.
Broken piece of code:

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 230210415) then
    if raritychance.Value > 1 then
    chance = math.random(1, raritychance.Value / 2) --ServerScriptService.GenerationHandler:129: invalid argument #2 to 'random' (interval is empty) 
    else
    chance = math.random(1, raritychance.Value)
    end
else
    chance = math.random(1, raritychance.Value)
end

your upper limit is less than your lower limit

1 Like

Well i know that, But i dont know what is causing the issue
Because i did not have this yesterday

Since you are dividing the upper limit by 2, any value less than 2 will be less than your lower limit and cause an error.

Nevermind, Roblox itself is just having issues right now cuz if the code was erroring, new blocks would not generate

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.