Datastore problem, don't know what do to do

Sometimes roblox studio can’t save the data correctly, but you could try this.

local RunService = game:GetService("RunService")
game:BindToClose(function()
	if (RunService:IsStudio())then
		wait(3)
	else
		for i, v in next, game:GetPlayers() do
			if v then
				coroutine.wrap(Set)(v) -- creates a new thread, to avoid that the repeat until affects the loop and all the players manage to save their data without having to wait.
			end
		end
	end
end)

This is only to improve saving when shutting down the game or exiting roblox studio test mode.

3 Likes

I’m having the same problem, maybe there are things that I did that would work for you (I’m having a problem of data not saving)

Post