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!