FindData = function(plr,level, gold)
	local success, msg = pcall(function()
		GetData = PlayerData:GetAsync(plr.UserId)
	end)
	if success then
		if GetData then
			level.Value = GetData[1]
			gold.Value = GetData[2]
		else
			level.Value = 1
			gold.Value = 0
		end
	else
		print("Data could not be saved.")
	end
end

I'm trying to create error handling for my datastore so that I don't encounter any bad errors that could remove purchases (with ingame gold or even robux)

I have this function to get player data and I'm not sure how to test if it'd work or not if there was an error? I'm nervous someone will spend robux to get some perks and then loose their purchase e.g buying gold and loosing their data?

2 comments

0

If you make a developer product and buy it in-game you won't lose robux since it'll be a "Test Purchase". Consider doing that. :)

0

as basicecstasy said use dveloper product :)