not 100% sure how to explain my issue so ill use an example
lets say i have a nested array in a datastore
sessionData[playerUserId] = {
Save1 = {
Name = "defaultname",
TestInt = 5,
LastSaved = "",
PartCount = 2,
partIndex = {
{
partShape = "sphere",
isCustomMesh = false,
customMesh = "nul",
partColor = "#FFFFFF",
partParent = StarterCharacter.Head,
},
--close part
{
partShape = "cube",
isCustomMesh = false,
customMesh = "nul",
partColor = "#FFFFFF",
partParent = StarterCharacter.Head,
}
--close part
}
--close index
}
}
theres DEFINITELY a better way to do this but i dont know it yet and this is at least formatted in a way i get it so its fine for now
anyway. how would i access the 2nd partShape
i know that
print(sessionData[playerUserId].partShape)
will return the FIRST partShape, and using my limited knowlege of file structure and reading other posts id think itd be
print(sessionData[playerUserId].Save1.partIndex[2].partShape)
since that is the path of the exact thing im trying to return
however this just returns the error
ServerStorage.PlayerHandler:84: attempt to index nil with 'partIndex'
ive tried changing the part names making them like part1/part2 instead of just using the [pos] so itd be partIndex.part2.partShape instead bit this gives the same error, i feel like im missing a really simple solution but my frantic googling across the last 3 days as i try to gain access to posting here has returned NOTHING, im not not sure if its just not possible or if im missing the key words in my searches or what, any help highly appreciated