Saving a table in a table with Player Data

Okay, so heres what Im trying to figure out; I’m trying to figure out how I would be able to save a table of an table to pdata. But im also trying to figure out how to check if a new business was created. What im trying to acheive is something like the Darkrp Job Creation, where you just Create a new business table, and it creates a new business.
example:


GMI_Businesses = {
Lemonade = {
			name = 'lemonade'
			price = 1
			amount = 0
			income = 1
			timer = 60
			timerstart = false
			}
Movies = {
			name = 'Movies'
			price = 1
			amount = 0
			income = 1
			timer = 60
			timerstart = false
			}
Mail = {
			name = 'Mail'
			price = 1
			amount = 0
			income = 1
			timer = 60
			timerstart = false
		}
BabySitter = {
			name = 'Baby Sitter'
			price = 1
			amount = 0
			income = 1
			timer = 60
			timerstart = false
			}
}



The reason on why I need to save the second set of tables, is that in the future im gonna allow the player to upgrade the timer, and the price is gonna have to change depending on the amount that the player owns.

You can’t use pdata with tables unless you encode the table with vON, bON or some table serializing library.
I really recommend against this and suggest you use the sql library instead.

would it be possible to use tabletojson for this? https://wiki.garrysmod.com/page/util/TableToJSON

Yes, but pay extreme attention to the data you save to that table, not all GMod values can be encoded by util.TableToJSON.

what do you mean by not all Gmod Values? Do you know any Examples that wont be encoded?

Something like this:
[lua]
local table = {
[ Player(1) ] = “Something”,
[ {} ] = “Soemthing2”,
}
[/lua]
basically any indexes that aren’t numbers or strings can’t be encoded to JSON.