Skip to main content

UnpackTable

This function was added in DSL 4

Description

Unpacks a table previously packed using PackTable.

function UnpackTable(serializedTable) --[[ ... ]] end

Parameters

  • serializedTable: string - The serialized string containing the packed table.

Return Values

  • table - The unpacked table.

Versions

  • DSL 7 - light userdata is supported, which lets you serialize hashes returned by ObjectNameToHashID.

Example

local serialized = PackTable({
name = 'Example',
value = 42,
nested = { key = 'value' },
flag = true,
})
local unpacked = UnpackTable(serialized)
print('Unpacked Table Name: ' .. unpacked.name)
print('Unpacked Table Value: ' .. unpacked.value)