Hi, i try to make a crate shop where when you click the crate you open it if you have enough money but i see that i get a error regarding comparing boolean to number.

```
game.ReplicatedStorage.Events.BoughtCrate.OnClientEvent:Connect(function(cratename, category)
local crate = game.ReplicatedStorage.Items[category].Crates[cratename]
openingHud.Frame.Crate.Image = crate.Picture.Image
itemsInCrate = crate[category]:GetChildren()
table.sort(itemsInCrate,
function(a,b)
return a.Chance.Value > b.Chance.Value
end
)
local randomnumber = math.random(0, 100)
local itemsPreselected = {}
for i, v in ipairs(itemsInCrate) do
if 100.0 <= randomnumber <= v.Chance.Value and i == 1 then -- Right here
table.insert(itemsPreselected, v)
elseif v.Chance.Value <= randomnumber <= 0 and i+1 == itemsInCrate then
table.insert(itemsPreselected, v)
elseif v.Chance.Value <= randomnumber <= itemsInCrate[i+1] then
table.insert(itemsPreselected, v)
end
end
local itemSelected = itemsPreselected[math.round(math.random(1, #itemsPreselected))]
openingHud.Frame.Preview:ClearAllChildren()
local part = itemSelected.Frame.Preview:Clone()
part.Parent = openingHud.Frame.Preview
part.Position = Vector3.new(0,0,0)
local camera = Instance.new("Camera", openingHud.Frame.Preview)
camera.CFrame = CFrame.new(Vector3.new(0,-8, 1), part.Position)
openingHud.Frame.Preview.CurrentCamera = camera
openTheBox()
end)
```