Hey guys! I'm trying to figure why doesn't this save script work. It doesnt send any error back but the value is set to false each time I rejoin/test the game
local Players = game:GetService("Players")
local DataStoreService = game:GetService("DataStoreService") -- Getting data store service
Players.PlayerAdded:connect(function(player)
local TrackersData = DataStoreService:GetDataStore(player.UserId.."Trackers") -- Getting data store
local LevelTracker = Instance.new("Folder")
LevelTracker.Parent = player
LevelTracker.Name = "LevelTracker"
local Level1 = Instance.new("BoolValue")
Level1.Parent = LevelTracker
Level1.Name = "Level1"
Level1.Value = false
local Value = TrackersData:GetAsync("Level1") -- Getting value from data store "TrackersData"
if Value == nil then
TrackersData:SetAsync("Level1",false) -- if value equals nothing then it'll creates it.
else
Level1.Value = Value
end
end)

4 comments
You're supposed to add those changes and give him the general idea of where everything goes.
I suppose, not "supposed to". Maybe it's just a good way that's going around?
Oh boy I cant figure...
KDarren12 I think it's pointless to explain how to save data as that question has been answered multiple times. I was just pointing out the problem that he has got.