local DSS = game:GetService("DataStoreService")
local DS = DSS:GetDataStore("ETSING BOY")
local ValuesToCreate = {TermsOfUse = {Name = "TermsOfUse", className = "BoolValue", Value = false}}
game.Players.PlayerAdded:Connect(function(Player)
local Folder = Instance.new("Folder", Player)
Folder.Name = "PlayerData"
for i,v in pairs(ValuesToCreate)do
local Val = Instance.new(v.className, Folder)
Val.Name = v.Name
end
local SavedData
local success, errormsg = pcall(function()
SavedData = DS:GetAsync(Player.UserId)
end)
if success and SavedData ~= nil then
print("SAVED DATA OF PLAYER "..Player.Name..": "..game:GetService("HttpService"):JSONEncode(SavedData))
for i,v in pairs(SavedData)do
local FindVal = Folder:FindFirstChild(v.Name)
if FindVal and FindVal.className == v.className then
FindVal.Value = v.Value
end
end
elseif success and SavedData == nil then
for i,v in pairs(ValuesToCreate)do
local FindVal = Folder:FindFirstChild(v.Name)
if FindVal and FindVal.className == v.className then
FindVal.Value = v.Value
end
end
elseif not success then
warn("Error while trying to get saved data of player "..Player.Name..": "..errormsg)
end
end)
game.Players.PlayerRemoving:Connect(function(Player)
if not game:GetService("RunService"):IsStudio() then
local Folder = Player:WaitForChild("PlayerData")
local SaveData = {}
for i,v in pairs(Folder:GetChildren())do
SaveData[v.Name] = {Name = v.Name, className = v.className, Value = v.Value}
end
print("SAVING DATA OF PLAYER "..Player.Name..": "..game:GetService("HttpService"):JSONEncode(SaveData))
local success, errormsg = pcall(function()
DS:SetAsync(Player.UserId, SaveData)
end)
if not success then
warn("Couldn't save data of player "..Player.Name..": "..errormsg)
end
end
end)
game:BindToClose(function()
for i, Player in pairs(game.Players:GetPlayers())do
local Folder = Player:WaitForChild("PlayerData")
local SaveData = {}
for i,v in pairs(Folder:GetChildren())do
SaveData[v.Name] = {Name = v.Name, className = v.className, Value = v.Value}
end
print("SAVING DATA OF PLAYER "..Player.Name..": "..game:GetService("HttpService"):JSONEncode(SaveData))
local success, errormsg = pcall(function()
DS:SetAsync(Player.UserId, SaveData)
end)
if not success then
warn("Couldn't save data of player "..Player.Name..": "..errormsg)
end
end
end)
So everytime I change "TermsOfUse" to true I make the datastore script print out the whole table it's going to save and there it says that "TermsOfUse" is false and the datastore saves it as false aswell.
what can I do about it??

17 comments
wait where is the problem?
The output gives no error but I have a bool value which I want to save by a datastore system and everytime I change the bool value to true the datastore saves it as false
so; in other words, u mean that when u set it to true, it reverts to false immediately after?
so u save it as false right? not that it loads as a false?
i can only think of something tht keeps resetting it as false
or that the script failed to set it to true?
yes it saves it as false and it loads it as false aswell because it was saved as false although i changed it to true
and i change the value by myself using the properties tab or using the console in studio
ok
then either ur hand is broken, or ur script to save it is
no offense
xd alright thanks for your help
OH CRAP
i remember
wait lemme type it out as answer
i need rep ;-;
how to rep im new