This script prints That it saved the data but it doesn’t, help (btw i allowed api)
local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("playerInstances")
game.Players.PlayerAdded:Connect(function(player)
local Punchs = Instance.new("Folder", player)
Punchs.Name = "Punchs"
local Beginner = Instance.new("BoolValue", Punchs)
Beginner.Name = "Beginner"
Beginner.Value = false
local Intermediate = Instance.new("BoolValue", Punchs)
Intermediate.Name = "Intermediate"
Intermediate.Value = false
local data = DataStoreService:GetDataStore(tostring(player.UserId))
local suc, err = pcall(function()
data = DataStore:GetAsync(tostring(player.UserId))
end)
if suc then
Beginner.Value = data.Value
Intermediate.Value = data.Value
else
warn(err)
end
end)
game.Players.PlayerRemoving:Connect(function(player)
local savetable = {
player.Punchs.Beginner.Value,
player.Punchs.Intermediate.Value
}
local suc, err = pcall(function()
DataStore:SetAsync(tostring(player.UserId), savetable)
end)
if suc then
print("saved bools")
else
warn(err)
end
end)