Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

DataStore working for most variables but not all?

Asked by 5 years ago
01local DataStoreService = game:GetService("DataStoreService")
02local myDataStore = DataStoreService:GetDataStore("myDataStore")
03 
04 
05game.Players.PlayerAdded:Connect(function(player)
06    local Original
07    local UFO
08    local OOB
09    local Bacon
10    local success, errormessage = pcall(function()
11        Original = myDataStore:GetAsync(player.UserId.."-OriginalCookie")
12        UFO = myDataStore:GetAsync(player.UserId.."-UFOCookie")
13        OOB = myDataStore:GetAsync(player.UserId.."-OOBCookie")
14        Bacon = myDataStore:GetAsync(player.UserId.."-BaconCookie")
15    end)
View all 58 lines...

If you look specifically at the OOB saves, for some reason it always prints false when I do print(shared.OOBCookie), and the only way it can come up false is if there is an error, because no script anywhere sets those shared variables to false, they are either true or nil. Although, I don't get a warning in the output like I'm supposed to, and everything else saves fine. I also know that when I end the playing that shared.OOBCookie is true. Can somebody help me?

Answer this question