Hello! I have a dictionary and I need to get the next key of a dictionary using a key. But it returns nil. Please help:
module.damage = {
["10"] = 2500;
["20"] = 5000;
["30"] = 15000;
["40"] = 35000;
["50"] = 50000;
["60"] = 75000;
["70"] = 125000;
["80"] = 300000;
["90"] = 475000;
["115"] = 750000;
["135"] = 1050000;
["175"] = 1350000;
["225"] = 1850000;
["275"] = "MAX";
}
print(next(module.damage, "10")) -- it prints nil
print(next(module.damage, "20")) -- it prints 30, which is correct
print(next(module.damage, "30")) -- it prints 80
print(next(module.damage, "40")) -- it prints 50, which is correct
print(next(module.damage, "50")) -- it prints 135
As you can see, most of them are all random.
If you read this, PLEASE HELP ME. Thank you so much!!