Right to Erasure solution?

Hello fellow developers. I’m currently trying comply with a “Right to Erasure” requested from ROBLOX. They stated “Please delete this User ID immediately from all of your records (e.g. games, data stores, etc.) from the following Game”, but I have very limited scripting experience.

I need someone who can confirm if this script will delete the User ID from the datastore. My game (tycoon) has plenty of data stores but I’m going to share with you just one script.

-- Remove the user data for the specified user ID
local dss = game:GetService("DataStoreService")
local ds = dss:GetOrderedDataStore("ZednovTycoon102")
local userIdToRemove = "1234567890"
local removeSuccess, removeError = pcall(function()
	ds:RemoveAsync(userIdToRemove)
end)
if removeSuccess then
	print("User data removed successfully")
else
	warn("Error removing user data: " .. removeError)
end

-- Define the settings
local Settings = {
	['Save'] = {
		['databaseName'] = "ZednovTycoon102", -- Change to have new saves -- original name ZednovTycoon101
		['giveCashToPlayersInGroup'] = { -- Will only be given once to new players if they joined the group
			['groupId'] = 11450941, -- Id of the group they must join to get cash
			['cashAmount'] = 5000  -- The amount of cash they will get
		}
	},
	['Test'] = {
		['showTouchTycoonButtonsGuiOutsideStudio'] = false -- If true will show it when someone plays your game outside studio
	},
	['Rebirth'] = {
		['enabled'] = false,
		['ignorePurchases'] = {"NameOfPurchase1", "PurchaseName", "NameOfAPurchase"},
		['resetCash'] = false,
		['teleportToo'] = "TeleportPart", -- Name of part here but part must be inside each tycoon
		['unlockPurchases'] = {
			{rebirthCount = 1, unlock = "rebirth1"},
			{rebirthCount = 2, unlock = "rebirth2"},
			{rebirthCount = 3, unlock = "rebirth3"}
		},
		['defaultCashNeededForRebirth'] = 10000000,
		['cashNeededForRebirth'] = {
			{rebirthCount = 1, cashAmount = 20000000},
			{rebirthCount = 2, cashAmount = 40000000}
		},
		['playerRespawned'] = { -- Will execute after player spawned
			{
				rebirthCount = 1,
				function(player)
					-- player.Character.Humanoid.WalkSpeed = 35
					-- code here to execute if player reached the rebirthCount or above.
				end
			},
			{
				rebirthCount = 2,
				function(player)
					-- player.Character.Head.Transparency = 1
					-- code here to execute if player reached the rebirthCount or above.
				end
			}
		},
		['playerReachedRebirthCount'] = { -- Will only run one time
			{
				rebirthCount = 1,
				function(player)
					-- code here to execute only once if player reached the rebirthCount.
				end
			},
			{
				rebirthCount = 2,
				function(player)
					-- code here to execute only once if player reached the rebirthCount.
				end
			}
		}
	}
}

return Settings

Additionally if anyone has experience with this; after publishing this script to my game, can I leave the script like this or do I have remove the User ID from this script and then republish it again?

Any help with be greatly appreciated!

2 Likes

Just run it in studio and check by trying to pull the records with that ID? You shouldn’t even need to publish to Roblox if you have the studio API enabled.

1 Like

I’m not sure how to pull the records but I do suppose I don’t need to publish it in studio, since the datastore saves does save in studio mode. (API is enabled.)

You could try a plugin like this one by sleitnick:

DataStore Editor

Gives you an easy way to manage datastores for something like this.
(idk of a free one that actually works though since I’ve only used this plugin, sorry)

I probably will save money using this in return of DevEx but dang man that’s still pricey. If I find no solutions at least this could work. Thanks for sharing though, it will help others too.

i didnt read much of ur script but, i think u can do it by doing SetAsync to key u provided for each player (like their userid) and just SetAsync a nil, so whenever u try to fetch data from that specific key again, it will return nil

1 Like

I think you dont have to do it since roblox is already handling that


GlobalDataStore | Documentation - Roblox Creator Hub

1 Like

there are free plugins

1 Like

Well unfortunately, I don’t see the point of them sending me another email again saying: “Please note that you must delete the User ID from all of your records, and not just from your data stores. The pages linked above are provided for informational purposes and are not intended to provide a comprehensive method of deleting User IDs.”, when they can just do it themselves.

Yes I did some research too and founded some too. I will definitely try one and see if I can verify that the User ID is indeed gone from my datastore.

1 Like