Right to Erasure request help

I got a message from ROBLOX in my dms saying that I need to remove a user’s data store from my game.

I am not a coder as the script I used was a free model that worked perfectly fine but I don’t know as to how I would remove the user’s data. How would I remove the data store from this user when using the script I am using.

Code of what I am using.

--[[Savin'
		Dem
			Stats	
--]]
game.Players.PlayerRemoving:connect(function(player)
	local datastore = game:GetService("DataStoreService"):GetDataStore(player.Name.."Stats")

local statstorage = player:FindFirstChild("leaderstats"):GetChildren()
for i =  1, #statstorage do
	datastore:SetAsync(statstorage[i].Name, statstorage[i].Value)
	print("saved data number "..i)
	
end
print("Stats successfully saved")	
end)


--[[
	Loadin'
		Dem
			Stats
--]]
game.Players.PlayerAdded:connect(function(player)
		local datastore = game:GetService("DataStoreService"):GetDataStore(player.Name.."Stats")
	
	player:WaitForChild("leaderstats")
	wait(1)
	local stats = player:FindFirstChild("leaderstats"):GetChildren()
	for i = 1, #stats do			
	stats[i].Value = datastore:GetAsync(stats[i].Name)
	print("stat numba "..i.." has been found")
		end
end)

I don’t want to mess up the data stores as their as 100k+ data stores saved from all of the users that have played my game.
Thanks!

There are tools on the plugin store to get this done easily but it does cost I believe 100 robux

Can you send the link please? I have enough money to get it.

https://www.roblox.com/library/701506235/DataStore-Editor?ViewInBrowser=true&CreatorId=308165&SearchId=400F5E5A-69A0-4335-887C-A2397164311B&Category=Plugin&Position=1&SearchKeyword=DataStore&CreatorType=User&SortType=Relevance
There is a tutorial in the description unfortunately i am not experienced with it to explain how to do it myself

Okay I will try that out, thanks!

You shouldnt have used player.Name as the key, because if someone changes their username then their data will be lost.

You really got yourself in quite the pickle here, since you cant get the username from a deleted account id.

You could do:
game:GetService("DataStoreService"):GetDataStore("[player name here if you find it]Stats"):RemoveAsync()

I contacted ROBLOX support and they were able to give me the username of the userid. Thank you for the help!

1 Like