Buy Limit 1 not functioningFixed

I have set a buy limit of 1on a command in the GUIShop, but whenever I attempt to use it it states "buy limit of 1 reached" 

In checking the Limits.json file it shows the following:

    "BLimit": {
      "": 1
    },​

As the item is a command there is no shortname for it, I have 7 other commands available for purchase as well all with no names. I am wondering if this is causing the GUIShop to be unable to differentiate between purchasing commands and having buy limits on them specifically. I also see nowhere to reset the purchases limit. I've tried clearing the Limits.json and it just rebuilds itself with all the data intact.

I can set something to a buy limit of 2 and it then allows me to purchase it once, if I try to buy it a second time it tells me "Buy limit of 2 reached" even though I've now only purchased it once.

I found I was able to enter a custom shortname, I did not realize that before, so I do have the commands set as their own individual shortnames to resolve that conflict. That said, I have purchased all of the items in testing, and now it registers that I have done so. I am unable to reset that, I would have thought the /cleardata command was for that, but that command is not resetting the buy purchases registered during testing.

All items must have a shortname either made up or legit ( depending on what you want it to be used for ).

Also, the only way to clear any data file manually would be to first unload GUIShop and then delete the file. 

Thanks, I will give that a go, what does the /cleardata command do then?

Merged post

No luck, unloaded GUIShop, deleted limits.json re-loaded GUIShop and attempted the buy, still says "Buy Limit of 1 reached"

  "Shop - Shop List": {
    "Baby Pack": {
      "DisplayName": "Baby Pack",
      "CraftAsDisplayName": false,
      "Shortname": "backpack1row",
      "MakeBlueprint": false,
      "AllowSellOfUsedItems": false,
      "Condition": 0.0,
      "EnableBuy": true,
      "EnableSell": false,
      "Image": "https://www.innsmouthcharnel.com/wp-content/uploads/2022/02/1.png",
      "SellPrice": 0.0,
      "BuyPrice": 25000.0,
      "BuyCooldown": 0,
      "SellCooldown": 0,
      "BuyQuantity": [],
      "SellQuantity": [],
      "BuyLimit": 1,
      "BuyLimitResetCoolDown": 0,
      "SellLimit": 0,
      "SellLimitResetCoolDown": 0,
      "KitName": null,
      "Command": [
        "oxide.grant user $player.id backpacks.use",
        "oxide.grant user $player.id backpacks.gui",
        "oxide.grant user $player.id backpacks.use.1",
        "oxide.revoke user $player.id backpacks.use.2",
        "oxide.revoke user $player.id backpacks.use.3",
        "oxide.revoke user $player.id backpacks.use.4",
        "oxide.revoke user $player.id backpacks.use.5",
        "oxide.revoke user $player.id backpacks.use.6",
        "oxide.revoke user $player.id backpacks.use.7",
        "oxide.reload Backpacks"
      ],
      "RunCommandAndCustomShopItem": false,
      "GeneTypes": [],
      "SkinId": 0​

After I made the attempt at purchase this was entered into Limits.json

    "BLimit": {
      "backpack1row": 1,
      "backpack2row": 1,
      "backpack3row": 1,
      "backpack4row": 1,
      "backpack5row": 1,
      "backpack6row": 1,
      "backpack7row": 1
    },
    "SLimit": {}

Perhaps I'm just missing something obvious.



Merged post

Is there something I've done wrong in this bit of code, as I'm still not able to get it to work correctly. 

The latest update resolves the limit count starting wrong. 

Locked automatically