Key-value pair with value as empty table inaccessible

Hi.

I have the following structure for some data in my game:

Furnishings = {
    Mood = {},
    Energy = {},
    Hunger = {},
    Decor = {},
    Special = {}
},
Secret = {},
StudioEssentials = {
    ...
},

However I can’t reference the Secret key at all, and when printing the data it appears to be non-existent.
P.S. What is shown above is how the data is structured by default, so the Secret key should always exist, though it’s value will not always be an empty table.

What I get when printing the data:
image
As seen above, Secret = {} is not present at all.

At first I thought it had to do with the value being an empty table (first thought was an empty table is evaluated as false), but I have other key-value pairs present where the value is an empty table.

Any help would be appreciate as I am stumped, thanks!

Can you show the code where you are printing the tables ?


As seen the Secret key doesn’t exist. I get nil

This is just a wild guess but try to add a ... like you did with StudioEssentials. All the other tables have initial items inside of them.

Issue still persists 30char30char

I’ve realised the cause of my problem. When a player joins the game for the first time, the data above gets overwritten, and I forgot to include the Secret key in the InitializeStudioData function.

Forgot this line even existed

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.