PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

GetMetadata

This function returns the metadata associated with the latest version of the object.

See Also

  • Articles/Data store|Data Stores, an in-depth guide on data structure, management, error handling, etc.

Returns

Return Type Summary

Metadata associated with the key.


Code Samples


Get Metadata for Key

local DataStoreService = game:GetService("DataStoreService")

local experienceStore = DataStoreService:GetDataStore("PlayerExperience")
 
local success, currentExperience, keyInfo = pcall(function()
	return experienceStore:GetAsync("User_1234")
end)
if success then
	print(currentExperience)
	print(keyInfo:GetMetadata())
end