#how can i create a table inside of a table that has the players name

3 messages · Page 1 of 1 (latest)

tawdry wind
#

local CDR = {}

function CreateCDRTable(player)
    table.insert(CDR,player.Name)
    
    local NewTable = {
        ["DAta"] = 0
    }
    
    print(CDR)
    CDR[player.Name] = NewTable
end

i tried this but it wont work how can i solve this?

torpid dune
#

Your current function inserts a string of the player's name before trying to add NewTable to CDR using the player's name as an index. The insertion part of the script isn't necessary

local CDR = {}

function CreateCDRTable(player)
    local NewTable = {
        ["Data"] = 0
    }
    CDR[player.Name] = NewTable
end

Let me know if this works