Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

DataStore request was added to queue. What i need to do?

I'm trying to do data saving for my game. Can anyone help?

game.Players.PlayerRemoving:Connect(function(player)
	local Worked, Errorey = pcall(function()
		local data = game:GetService("DataStoreService"):GetDataStore("Data")
		data:SetAsync(player.UserId, game.ReplicatedStorage.Cash.Value)
		data:SetAsync(player.UserId, game.ReplicatedStorage.Rebirth.Value)
		data:SetAsync(player.UserId, game.ReplicatedStorage.X5.Value)
		data:SetAsync(player.UserId, game.ReplicatedStorage.X2.Value)
	end)
	if Worked then
		print("Okay,i saved data store. Fuw-w-w!")
	else
		warn(Errorey)	
	end
end)

( I'm bad at programming lol )

2 comments

0

you have the players value in ReplicatedStorage?

0

I don't know English well (I'm Russian), so can you explain what exactly?

1 answer

You are saving too frequently therefore it adds it to a queue because you are saving too frequently. Maybe add a wait() for saving.

This discussion is preserved as it was. New answers, comments, and votes are closed.