PcoWSkbVqDnWTu_dm2ix
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