Delete A Players Data Using Profile Service

How can I use :WipeProfileAsync to remove the data of a player in any server? Is this even possible? I’m pretty sure you have to release a players Profile before removing their data, but how can I release their profile if I am in a different server? I played around with it and every time I try using WipeProfileAsync it just errors and I’m not sure why. Also, this works fine in studio but not in game.

1 Like

I think that this tutorial can help you

https://madstudioroblox.github.io/ProfileService/api/

1 Like

I have read the tutorial. WipeProfileAsync just tells me what it does and not really how to use it in the case I need it for.

Can I ask why you’d want to do this?

So I can delete any players data via a data removal request or such.

1 Like

Remember how you load player’s profile?

local profile = ProfileStore:LoadProfileAsync("Player_2312310", "ForceLoad")

You use the same string to wipe their profile.

ProfileStore:WipeProfileAsync("Player_2312310")

That’s what it meant by profile_key.

1 Like

But why do you want to wipe a player’s data without releasing their profile? I’m trying to think of a use case for completely wiping an active player’s data.

Can’t you just use DataStore:SetAsync(UserID, nil)?

That’s the problem, how do I release their profile?

Also I’m confused on where to run my code, in game, in studio, in the command bar, where?

As you would normally, e.g:

Players.PlayerRemoving:Connect(function(player)
    local profile = cachedProfiles[player]
    if profile ~= nil then
        profile:Release()
    end
end)

You can kick any active player using inbuilt commands, therefore forcing the .PlayerRemoving event. Having said that, I’m not totally sure whether the player has to have left in order to release their profile, at the very least it seems advisable.

Any of the above really. If you want to do it in game you can just connect the kick()/wipe profile script to a chat command like /wipe UserName or similar. It wouldn’t be too hard to do.

That works great, my problem is though. How do I use WipeProfileAsync on a player who needs their data deleted, but never joins back again?

Your only solution is an external server / api that would accept your command and open custom storage to delete data based on a log existing or not (theory)

Okay, so how do people normally deal with roblox data removal requests? I could always just make it so once a player joins it checks a list of players who need data removed and remove it, if that still counts as data removal?

I’m not sure what the regular practice is, but we’re pretty hindered by not having the data removal request input on the website then automatically remove through an engine api… This requires diverse workarounds, but I think I’m going with a module or command that takes their userid and deletes all their data in one press. Not only could this be on your side, you could also add the option in-game, so they can delete the data themselves.

Ive decided to go with the tried and tested method of just using Data:RemoveAsync(). This allows me to do it in studio or in game so it’s my best option, appreciate all the help.

1 Like

Their profile has already been released if they have already left. It doesn’t need to be a freshly released profile for you wipe their profile.

Doesn’t seem like the best idea.

Why not? It worked fine for me.

Mixing and matching methods for data saving is at the very least bad practice. I’m also not understanding your issue with the inbuilt methods in ProfileService. Having said that, it works for you, so I suppose that’s what matters.

I don’t really know either. All I know is that sometimes roblox says that you need to erase a certain players data. My issue was just how do I do that using Profile Service. But I have actually just figured it out. I can use WipeProfileAsync in the command bar and it deletes the data so, problem solved. I just have to Grab the profile first using ProfileService.GetPlayerProfile. Thanks for the help.

2 Likes