#HELP DATASTORE (INCREMENT ASYNC)

43 messages · Page 1 of 1 (latest)

kind orbit
#

how do i increment a value within a table with the incrementAsync() function?!?

CODE:

local DTS = game:GetService("DataStoreService")
local BankUserData = DTS:GetDataStore("BankUserData01")
local DataTMP = {
    ["Password"] = "";
    ["UserID"] = "";
    ["Xeni"] = 0;
}

BankUserData:IncrementAsync("MMS", 10, "Xeni") --???!
print(BankUserData:GetAsync("MMS"))
chilly horizon
#

Incrementing is for numbers

kind orbit
chilly horizon
kind orbit
#

so i have to do it with update

#

async

chilly horizon
#

Yes

kind orbit
#

and it does the same thing right?

#

like updating

#

and not getting async and then setting it

#

u know what i mean

#

alright thx

#

uh

#

@chilly horizon

#

u mind helping me how to do that

#

how do i make a function for that, for update async

#

for the second argument

#

u know?

#

updateasync("MMS", ???)

chilly horizon
#
function(oldData)
    local newData = oldData
    newData.Xeni += 10
end
#

I think it's like that

kind orbit
#

uh

strong owlBOT
#

studio** You are now Level 9! **studio

kind orbit
#

alright

#

ima try it

chilly horizon
#

@kind orbit

kind orbit
#

yes

#

?

#

@chilly horizon

#

i need help

#

pls put the fuction with updateasync together

chilly horizon
#

Oh

kind orbit
#

dk how to

chilly horizon
#
DS:UpdateAsync("Key", function(oldData)
    local newData = oldData
    newData.Xeni += 10
    return newData
end)
#

@chilly hawk

#

Oops

kind orbit
#

lol

chilly horizon
#

@kind orbit

kind orbit
#

ye

#

thx

#

ye it works

#

nice