DataStoreIncrementOptions

DataStoreIncrementOptions : Instance

Overview

GlobalDataStore:SetAsync() 메서드를 사용할 때 부가 정보(메타데이터)를 지정하는 객체입니다.

Properties

Methods

GetMetadata

해당 객체가 가진 부가 정보(메타데이터)를 반환합니다.

Parameters

Return

Dictionary

키-값 형태의 부가 정보(메타데이터)입니다.

Code Samples

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

SetMetadata

GlobalDataStore:IncrementAsync() 메서드를 사용할 때 함께 저장할 부가 정보(메타데이터)를 등록합니다.

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