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

Why is my data very inconsistent?

Hello i am using a regular datastore script and whenever i force shutdown for updates there a few people whoos data is missing. Please help

2 comments

0

Can you add the script?

0

If you cannot, answer these questions, does it autosave every X seconds or does it save with a button/command/ when the player leaves. Or is it a datastore issue that you can fix with pcall?

1 answer

i have it autosave and it comes up with a problem in the autosave here is the code: while true do wait(120) if can_Save.Value == true then local success,message=pcall(function() StrengthData:SetAsync((uniquekey), {strength.Value}) RebirthData:SetAsync((uniquekey), {rebirths.Value}) OtherData:SetAsync((uniquekey), {Egg.Value,FishingDuck.Value,ChillDuck.Value,Swimming.Value,Camo.Value,Wise.Value,Evil.Value,Stone.Value,Bush.Value,Behind.Value,King.Value,Kills.Value,KingC.Value,current_duck.Value})

			end)
			if not success then
				print("not really found dude")
				
				wait(30)
				local success,message=pcall(function()
					StrengthData:SetAsync((uniquekey), {strength.Value})
					RebirthData:SetAsync((uniquekey), {rebirths.Value})
					OtherData:SetAsync((uniquekey), {Egg.Value,FishingDuck.Value,ChillDuck.Value,Swimming.Value,Camo.Value,Wise.Value,Evil.Value,Stone.Value,Bush.Value,Behind.Value,King.Value,Kills.Value,KingC.Value,current_duck.Value})
					print("done")
				end)
					
			end
			
			
			
		end
	end

1 comment

0

while true do wait(120) if can_Save.Value == true then local success,message=pcall(function() StrengthData:SetAsync((uniquekey), {strength.Value}) RebirthData:SetAsync((uniquekey), {rebirths.Value}) OtherData:SetAsync((uniquekey), {Egg.Value,FishingDuck.Value,ChillDuck.Value,Swimming.Value,Camo.Value,Wise.Value,Evil.Value,Stone.Value,Bush.Value,Behind.Value,King.Value,Kill

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