Datastore not woring

my datastore isn’t working, I enabled the “Enable Studio Access To API Services” for sure, my script:

local DataStore = game:GetService("DataStoreService")
local AddedNumber = DataStore:GetDataStore("AddedNumber")

script.Parent.ClickDetector.MouseClick:Connect(function()
	local succes = pcall(function()
		AddedNumber:SetAsync(script.Parent.Value.Value, script.Parent.Value.Value + 1)
	
	end)
	local success2 = pcall(function()
		AddedNumber:SetAsync(script.Parent.SurfaceGui.TextLabel.Text, tostring(script.Parent.Value.Value))
	end)
	if succes and success2 then
		AddedNumber:SetAsync(script.Parent.Value.Value, script.Parent.Value.Value + 1)
		AddedNumber:SetAsync(script.Parent.SurfaceGui.TextLabel.Text, tostring(script.Parent.Value.Value))
	end
end)

Do you get any errors in the output?

If not add the error message as shown below as it shoud present an error

DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 0 (x3)

Hello, there is a limit on using SetAsync, that’s why you got that error

If you checked on Data Stores API, you will see that there is a limit on using the same key on SetAsync, it’s about 6 seconds

That normally sent when you send too many requests. I suggest limiting the amount of times you interact with the datastore.

it is still not working.

i made a new datastore for the text label
and my script became:

local DataStore = game:GetService("DataStoreService")
local AddedNumber = DataStore:GetDataStore("AddedNumber")
local ConvertTostring = DataStore:GetDataStore("ConvertTostring")

script.Parent.ClickDetector.MouseClick:Connect(function()
	local succes, error = pcall(function()
		AddedNumber:SetAsync(script.Parent.Value.Value, script.Parent.Value.Value + 1)
	
	end)
	local success2, error2 = pcall(function()
		ConvertTostring:SetAsync(script.Parent.SurfaceGui.TextLabel.Text, tostring(script.Parent.Value.Value))
	end)
end)

	

Are you trying to prints out the data you saved?

If so, you need to use GetAsync with the key you have set

i am trying to make the textlabel turn into the value.

You’re kinda overusing the SetKey command. Which causes the datastore to enter the queue.

I guess what your doing is add a number on click. The better way is just checking if the number changed and save it into the datastore.

local DataStore = game:GetService("DataStoreService")
local AddedNumber = DataStore:GetDataStore("AddedNumber")
local ConvertTostring = DataStore:GetDataStore("ConvertTostring")
local Number = -- IntValue instance

script.Parent.ClickDetector.MouseClick:Connect(function()
         Number.Value = Number.Value + 1
end)

Number:Changed(function())
       Wait(6.0) -- due to write request limit.
       AddedNumber:SetAsync(--Do whatever you want doe)
end)

What value?..

To what am i seeing here is that you’re making a part to where when the player clicks, it will saves data twice, with a key and value that you don’t provide any explanation…

i even tried:

local DataStore = game:GetService("DataStoreService")
local AddedNumber = DataStore:GetDataStore("AddedNumber")
local ConvertTostring = DataStore:GetDataStore("ConvertTostring")

script.Parent.ClickDetector.MouseClick:Connect(function()
	local succes, error = pcall(function()
		AddedNumber:SetAsync(script.Parent.Value.Value, script.Parent.Value.Value + 1)
	
	end)
	local success2, error2 = pcall(function()
		ConvertTostring:SetAsync(script.Parent.SurfaceGui.TextLabel.Text, AddedNumber:GetAsync(script.Parent.Value.Value))
	end)
end)

You should use a table for Setting Async, instead of multiple values. Also, try adding CloseToBind function.