DataStore2: How to remove players Data?

How would I go about removing a particular players data in DataStore2? I’m familiar with regular datastores, but I’ve been asked to help a friend out with his already existing game, and I’ve never used DataStore2.

I did find the api: API - DataStore2

But I’m not sure if ClearCache() removes ALL data or if it’d remove for a particular player.

I’m too scared to try anything on the chance I remove ALL existing data for a game that hundreds of people have data saved on already. This is the only relevant information in the script I believe.

local storage = require(numbers)
local statStore = storage(storeKey, player)
local stats = statStore:Get()

1 Like

I think :ClearCache() removes the data updated in that playing session.
But I think you can simply remove the players data by doing statStore:Set(nil)?

1 Like

Please search for previous posts relating to this as this has been asked various times before.

Nonetheless, here is the answer:

1 Like