#UpdateAsync params
1 messages · Page 1 of 1 (latest)
the second parameter is just a function. And whatever the function returns will be the new value for the DataStore
its just like SetAsync but the functions value is the new value
yes but i tried typing a function there and a return after but since it was already in a function it thought i was trying to return from the main function (savedata()) it was inside
But you do understand that the 2nd parameter needs to be a function
yes but how can i do that with the UpdateAsync already in a function
DataStore:UpdateAsync(Key, function()
end)
thats what i DID
and?
maybe make a new function called GetData which returns the new data
and give it to the 2nd parameter

This cannot be that entertaining 💔
watching how long it takes for someone to come up with a correct answer is lowkey pretty entertaining
specially for something as obvious and simple to research as this
fair enough
pyro please i seriously need to know this i dont care how big of an idiot i look like🙏
https://create.roblox.com/docs/cloud-services/data-stores#update-data
see also https://create.roblox.com/docs/reference/engine/classes/GlobalDataStore#UpdateAsync
consider referring to the source code of ProfileStore and review how they use it
another example https://create.roblox.com/docs/resources/plant-reference-project
all sorts of goodies in the plant project so that's a fun one all round
all hail the great pyro

