Datastore2:Increment() and Datastore2:Set() works sometimes

Hello! I’ve been trying to make a Clicker game using Datastore2. The problem is that when incrementing or setting multiple times a second, it sometimes skips over the line and doesn’t set or increment at all.

I’ve tried using spawn(function() in hopes of solving this issue but that did nothing. It would happen whilst auto-clicker is enabled, as it is incrementing multiple times a second.

Rebirth part:

  spawn(function()
 	datastore2("clicks", player):Set(0)
  end)
  datastore2("gems", player):Increment(rebirthAmount, 0)
  datastore2("rebirths", player):Increment(rebirthAmount, 0)

Clicker part:

datastore2(“clicks”, player):Increment(1 + datastore2(“rebirths”, player):Get(0), 0)

1 Like

Also experiencing this same problem with set & increment. Trying to increment a value in rapid secession sometimes causes the function to not register.

1 Like

Are you using the most recent version from the GitHub master branch, not the roblox model or from the “releases” tab in GitHub (as I believe the issue in question is still present here)?

1 Like

Yeah. I copied and pasted all source codes from the master branch. I still can’t find the issue.