I have this but it does not seem to store any data.
local DataStore = game:GetService("DataStoreService") local ds = DataStore:GetDataStore("AbilitySaveSystem") print(ds) game.Players.PlayerAdded:Connect(function(player) print(player.userId) local Power = Instance.new("StringValue",player) Power.Name = "Power" print(ds:GetAsync(player.userId)) if ds:GetAsync(player.userId) ~= "None" then Power.Value = ds:GetAsync(player.userId) print("He had an ability") else Power.Value = "None" print("He had no ability") end ds:SetAsync(player.userId, Power.Value) Power.Changed:Connect(function() ds:SetAsync(player.userId, Power.Value) print("Updated Ability: ".. ds:GetAsync(player.userId)) end) end) game.Players.PlayerRemoving:Connect(function(player) print("Bye") ds:SetAsync(player.userId, player.Power.Value) print("Successfuly saved "..player.userID..": "..ds:GetAsync(player.userID)) end)
this is my method of using regular datastores it works pretty well for me
local Data = game:GetService("DataStoreService"):GetDataStore("AbilitySaveSystem") game.Players.PlayerAdded:Connect(function(player) local Power = Instance.new("StringValue") -- i think using instance parent is deprecated so i didnt use it here Power.Name = "Power" Power.Parent = player print("Gave "..player.Name.." Power Data") local SavedItems = Data:GetAsync(player.UserId) -- userId is Deprecated use UserId if SavedItems then Power.Value = SavedItems.Power or "None" print(player.Name.." had Power data") else Power.Value = "None" print(player.Name.." didn't have Power data") end end) game.Players.PlayerRemoving:Connect(function(player) local Saving = {["Power"] = (player.Power).Value; } Data:SetAsync(player.UserId, Saving) print("Saved "..player.Name.."'s Power Data") end)