My datastore consists of 4 values, three being int values and 1 a bool.
Lets say that the bool value is currently true, but I want to change it to false.
How would I do this without changing any of the int values?
DataStore:SetAsync(key, {1 ,2, 3, false})
This works, however it also changes the int values. Is there a way to get the player's current values or somehow not change the int values?
I know you can use GetAsync, but how would I implement that into the SetAsync, if even possible?
Edit: This is in case I want to change a player's value from inside studio at any time. I do not need help saving their value when they leave/periodically.
Edit2:
I figured it out.
local First = (DataStore:GetAsync(key)[1])
local Second = (DataStore:GetAsync(key)[2])
local Third = (DataStore:GetAsync(key)[3])
local Fourth = (DataStore:GetAsync(key)[4])
DataStore:SetAsync(key, {First ,Second, Third, false})
Whats pretty cool is that you can do First + 2 or whatever to give someone a little bonus.

1 comment
This seems like it works (haven't tested it though), however the solution I found I find easier to understand and simpler.