How would I updateasync a leaderstats?

You can write your topic however you want, but you need to answer these questions:

  1. I’m trying to use updateAsync() on a leaderstats (format used below). I looked up a bit but could only find actual value and not object.

I tried i few things but nothing worked. So I’m trying to find an example of what step I need to follow.

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local function addboard(player)
    local board = Instance.new("Folder", player)
    board.Name = "leaderstats"
    local cash = Instance.new("IntValue", board)
    cash.Name = "Cash" -- Exemple
end
1 Like

I don’t quite get the question. updateAsync() or SetAsync() would be used on a Datastore to update a players data on there.

If you just want to update the players Cash in your example above, then player.leaderstats.Cash.Value = 100 would work. To do this in game, you just need to establish what player value would be.
Did I misunderstand the question?

1 Like

What im trying to do is that if the players already got a data instead of using setAssync() I want to switch to updateAsync but in the studio wiki I couldn’t find the awnser to my questing. I could only see people updating value and not a leaderstats.

forgot to add. Update multiple Value*

Did you see this article?

1 Like

So orderedDataStore would be the solution to my problem?

1 Like

No, that would only be if you want to retrieve data to display on a leaderboard. orderedDataStore allows you to retrieve the top 10 values for example.

1 Like