DataStore request was added to queue. If request queue fills, further requests will be dropped. Try sending fewer requests.Key = 909130723 is the error (i know that even this the error in most cases the data store saves but it doesnt seem to now)

this is the code

local DataStoreService = game:GetService("DataStoreService")
local myDataStore = DataStoreService:GetDataStore("hackKW")

game.Players.PlayerAdded:Connect(function(player)
	wait()
	local data
	local data2
	local success, errorMessage = pcall(function()
		data = myDataStore:GetAsync(player.UserId)
		data2 = myDataStore:GetAsync(player.UserId)
	end)
	
	if success then
		player.leaderstats["Times Finished"].Value = data
		player.leaderstats["Points To Finish Game"].Value = data2
		print("data load success")
	else
		print("data load failed")
		warn(errorMessage)
	end
end)

game.Players.PlayerRemoving:Connect(function(player)
	local data
	local data2
	local success, errorMessage = pcall(function()
		data = myDataStore:SetAsync(player.UserId, player.leaderstats["Times Finished"].Value)
		data2 = myDataStore:SetAsync(player.UserId, player.leaderstats["Points To Finish Game"].Value)
	end)
	
	if success then
		print("data saved success")
	else
		print("data save failed")
		warn(errorMessage)
	end
end)

game:BindToClose(function()
	for i, v in pairs(game.Players:GetChildren()) do
		v:Kick("kicked in case of data loss prevention from when server crash")
	end
	
	wait(10)
end)

2 comments

0

Do you have the "Enable Studio Access To API Services" In your game settings turned on?

0

yup