Hey I am trying to make a database work for my users data,
In json I have my array layout like this
Summary
{
"9417418": {
"kills": "0",
"deaths": "0",
"xp": "0",
"credits": "0",
"dz_credits": "0",
"equipped": {
"weapons": {
"Vintorez": {
"attachments": [],
"skins": []
},
"HoneyBadger": {
"attachments": [
"ACOG"
],
"skins": []
},
"ff": {
"attachments": [],
"skins": []
}
},
"armour": {
"Headgear": {
"skins": []
},
"TorsoGear": {
"skins": []
},
"BottomsGear": {
"skins": []
}
}
},
"inventory": [
"HoneyBadger",
"Vintorez",
"Glock",
"ff"
]
}
}
The issue is when I want to give the user the weapons etc, I cannot get the first gun from the array when lua doesn’t know what gun it is since its a dictionary
But I need to make the weapon a dictionary to save attachments etc as seen in the Json layout.
How can I get the first name of the dictionary for example if it was an array I would do data.equipped.weapons[1]
Output would be
“Vintorez”