Need help with math.random error

So now that my previous camera issue was fixed, I made a double luck gamepass and then i encountered a new error
ServerScriptService.GenerationHandler:49: invalid argument #2 to 'random' (interval is empty)
Piece of code that is not correctly working:

								local chance
								if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId, 230210415) then
									chance = math.random(1, raritychance.Value / 2)
								else
									chance = math.random(1,raritychance.Value)
								end

Broken line: chance = math.random(1, raritychance.Value / 2)

the 2nd argument passed into math.random (in ur case: raritychance.Value / 2) must always be greater than the 1st argument

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