How to I add this to a table in a script

how can I do this but adding it into a table by scripting:

local EXAMPLESAVEDTABLE={
	Cash={Value = 500}
}

formatting doesn’t matter I just need to find out how to add it like Points={Value=5}

Why do you need the value key anyway? Could it not just be {Cash = 500, Points = 5}?

Anyway, you can use table.insert or assign the key to set values in a table.

--for numerical indexes (often referred to as arrays but they aren't true arrays)
local example  = {
    [1] = {["Cash"] = 500}
}

table.insert(example, {["Points"] = 5})
local example = {
    ["Cash"] = {["Value"] = 500}
}

example["Points"] = {["Value"] = 5}
1 Like

I forgot I can just do that

1 Like

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