Alright so it may sound a bit repetitive, but try to understand. Specifically a boolean value, I need to save the value of the Boolean Value itself. Since I know you cant save the Boolean Value itself, I know you can save the value of it. Anyway, I tried to do it here, but It doesn't work. Can anyone please explain why?
So, first I used SetAsync() which didn't work, so then I try UpdatedAsync() which doesn't work either. All I need to do is just save the value of the BoolValue so which one should I use? P.S. Everyone receives a bool value inside the folder named PlayerValues that is cloned to every player.
Every time I join the game it says the value is saved, but when I rejoin it says that it is false, turns true, and saves it again.
game.Players.PlayerAdded:Connect(function(player)
local ValueDataStore = game:GetService("DataStoreService"):GetDataStore("SaveValueDataStore")
local ValueNeedSaving = player:WaitForChild("PlayerValues",1):FindFirstChild("ValueNeedSaving")
local valuekey = 0
if ValueNeedSaving.Value == true then
print("This value is already true!")
else
--SAVE TABLE PART--
ValueNeedSaving.Value = true
ValueDataStore:UpdateAsync(AlreadyGivenValue.Value, function()
return AlreadyGivenValue.Value or 0
end)
print("The Value was saved and it will stay true!")
end)

3 comments
Could you make your question a bit more clear? Do you want to save the BoolValue object itself or BoolValue.Value?
The BoolValue.Value
You didn't load it, use SetAsync("player",table_or_values)