Changing table datastore of offline user

I use tables to save my data and I wish to add a “remove warning”, “remove kick” and “unban” button.

I’m unaware on how to remove someone’s stuff data if they are offline and their data is saved as a table
If i only want to remove warning, then how would i go about keeping the other values as they are?

For me, the datastore table saves like this.image
If I want to change Kicks, I still have to go through warnings.
What i’ve tried so far, is

targetsds:SetAsync(targetsUserId,_,+1 )

(remove _)
So basically I just put 2 commas and left the first one unused, and the +1 just does not seem logical.

This is how data is put in again:
image

Save the data like so

local Save = {
	Warnings = Warnings;
	Kicks = Kicks;
	Bans = Bans;
}

Access and remove like so

Save.Warnings = {}

DATASTORE:SetAsync(UserID, Save)

So If i were to remove warnings, i would be

local Save = {
Warnings = Warnings - 1;
Kicks = Kicks;
Bans = Bans;
}

Save.Warnings = {}

DATASTORE:SetAsync(UserID, Save)

  • And with kicks it would be the same, but instead of Save.Warnings it would be Save.Kicks?

Ah if it’s a number index then do this for the saving part

Save.Warnings = Save.Warnings - 1

DATASTORE:SetAsync(UserID, Save)

Setting the index of a table;
Allows you to directly index the data instead of guessing what the data is.

Remember if you want to access warnings above, you have to save it like this

local Save = {
	Warnings = NUMBEROFWARNINGS;
	Kicks = NUMBEROFKICKS;
	Bans = VALUE;
}


image
How would I tackle this?

You tackle this by entering a real username, the username you entered doesn’t exist.

Well I assume that the “target” isn’t the correct name.

Print the Target variable and make sure it’s right