How to Delete Data with UserID from Datastore?

Hi, it’s my first time getting this, but Roblox had requested me to delete a user’s id from all records (datastore) in my game. Can someone please tell me how can I do this?

9 Likes

In your PlayerAdded event, get the DataStore(s) you’re using and use RemoveAsync like so:

DataStore:RemoveAsync(key)
if you don’t know what I mean by key

The ‘key’ parameter should be replaced with whatever you are saving and loading the player’s data with; basically a string or value that helps you determine if the data belongs to someone or not.

If you’re using SetAsync / UpdateAsync and you setting a value to a player’s UserId, then you’d copy the UserId from the message and replace the ‘key’ parameter with the UserId.

If you instead saved the players name (Player.Name) then you could search https://www.roblox.com/users/USER_ID_HERE, copy the name, and then replace the ‘key’ parameter with that name.

—————————————

Hope you can get thru this smoothly. I personally haven’t got this message.

Good luck :+1:

1 Like

Do you have a datastore editor plugin?

If not, heres one from Coeptus (Creator of Welcome to Bloxburg)

Its just an old version of Sleitnicks Datastore editer that Coeptus has edited

4 Likes

so just like this?

local dss = game:GetService("DataStoreService")
local ds = dss:GetDataStore("DataStore1")

game.Players.PlayerAdded:Connect(function(player)
	ds:RemoveAsync(4760160964)
end)
1 Like

That won’t work because the player can’t join the game if they’re banned from Roblox.

You could try copy and paste that into the command bar minus the PlayerAdded event.

3 Likes

so when I join my own Roblox game from the Roblox client and then paste in

ds:RemoveAsync(4760160964)

into the command bar, then it should work?

1 Like

You can use the command bar in Roblox studio.

I don’t exactly know for sure, but if you want you could use a datastore editor plugin. Another thing is has this user actually joined your game before or has Roblox just sent you an automated message not knowing if they have data saved?

Can I see the code you use to save the data? I want to make sure you’ve written the key write.

3 Likes

Im not sure, but I assume that the user did join and play my game before their account got deleted. Then Roblox had to notify me to delete their data from my game.

2 Likes

Yes, @Modern_Developer2201 is correct. I just did some research on this “Right to Erasure” message and it gets sent to you when a player is terminated.

3 Likes

Does every Roblox user that has a game that this user joined get a message?

3 Likes

Can I see the code you use to save the data? I want to make sure you’ve written the key right.

You should use a datastore plugin to make sure its actually getting deleted and to see if the data actually existed.

4 Likes

I’m not sure, I’ll have to do some more digging into that.

I just searched up “Right to Erasure Roblox” in Google. You could also search something similar to that here on the DevForum (even though most of the results on Google do link to DevForum posts).

2 Likes

Ah, alright. I didn’t even know that Roblox requests for data to be deleted from games lol. Another thing is Roblox should probably just automatically delete the data themselves but one reason I think they don’t is because they don’t want to delete the wrong thing.

3 Likes

Yeah. It’s pretty vague, and all the sources I’ve looked at don’t specifically state that every single game that the account being terminated / deleted joined has to delete their data; however, one source claimed that any game that with a datastore that saved that specific player into their datastore MUST remove that player’s data.

From some other stuff I’ve read, it seems like Roblox is required to do this because of Europe’s data privacy and security law, General Data Protection Regulation (GDPR).

I’m pretty sure it still affects players from around the world, even if they’re not living in Europe.

2 Likes

yo I tried using the command bar to delete the user’s data, but it returned an error

2 Likes

Ah, ok.

Is this for any accounts that get terminated or only for accounts that’s done something horrible?

Is Roblox actually going to do anything if you don’t delete the datastore?

2 Likes

You haven’t defined “ds” in the command bar yet.

2 Likes

did this work?

2 Likes

You need to add the datastore variable.

Which are these 2 lines

local dss = game:GetService("DataStoreService")
local ds = dss:GetDataStore("DataStore1")

ds:RemoveAsync(4760160964)

Make sure to change DataStore1 to the name of your data store and add whatever in the line with 4760160964 like Player_4760160964 or Player.4760160964 whatever you save the key as.

4 Likes

Read the post I made before this and its best to get a datastore editor plugin to browse for the datastore.

3 Likes