This is very bad scripting. I know. But why is the table like this:
table = {
1,
2,
3
}
local DataStoreService = game:GetService("DataStoreService")
local DataStore1 = DataStoreService:GetDataStore("ADifferentName") -- Change this with a different name.
local DataStore2 = DataStoreService:GetDataStore("AnotherName")
game.Players.PlayerRemoving:Connect(function(Player)
local playerID = Player.UserId
local data = Player.leaderstats.Legit.Value
local levels = {
}
for i, v in pairs(Player.lvls:GetChildren()) do
table.insert(levels, tostring(v))
end
print(levels)
local success, errormessage = pcall(function()
DataStore1:SetAsync(playerID, data)
DataStore2:SetAsync(playerID, levels)
end)
if success then
print("data successfully saved!")
else
print("hmmmmm no bueno")
warn(errormessage)
end
end)

1 comment
nope