DataStoreIncrementOptions

DataStoreIncrementOptions : Instance

Overview

Properties

Methods

GetMetadata

Gets the custom metadata set with this DataStoreSetOptions instance

Parameters

Return

Dictionary

Code Samples

local options = Instance.new("DataStoreIncrementOptions")
options:SetMetadata(
{
    Reason = "DailyMission"
})
			
print(options:GetMetadata())

SetMetadata

Sets custom metadata to be associated with the key

Parameters

Dictionary InMetaDataTable

Return

void

Code Samples

local DataStoreService = game:GetService("DataStoreService") 
local GoldStore = DataStoreService:GetDataStore("PlayerGold") 

local success, errorMessageOrLoadValue = pcall(function()
    local userIds = nil
    local options = Instance.new("DataStoreIncrementOptions")
    options:SetMetadata(
    {
        Reason = "DailyMission"
    })
			
    GoldStore:IncrementAsync(player.UserId, 1, userIds, options) 
end)

Events

Last updated