Hi. Currently using a Dictionary to save DS2 prison arrests.
My dictionary looks something like this:
{
Arrest = {“ArrestingOfficer”,“Reason”,Duration},
Arrest = {“anotherOfficer”, “anotherReason”,Duration},
}
I’m unsure if this is a good way, seeming as dictionarys use keys to access, so in order to write into this dictionary, I think it’d mess up because there’s already an arrest key? Could someone explain this, and how I could write into, or create a more efficient way to do this?
When saving a key which already exists in a dictionary(Arrest) it will overwrite the old one. Instead you could store an array inside the dictionary key “Arrests” containing each arrest:
local data = {
Arrests = {
arrest1,
arrest2,
arrest3,
--etc.
}
}