Hello! How is it going? I created a system (Which works, tested on multiple accounts), and one of my beta testers said that his data didn’t transfer properly.
Is there any way to improve my system? Please let me know. Thanks! WE
local DataStore2 = require(game:GetService("ServerScriptService"):WaitForChild("DataStore2"))
local DataStoreService = game:GetService("DataStoreService")
local CharactersDataStore = DataStoreService:GetDataStore("Characters")
local TheDatastore = DataStore2.Combine("Characters", "CharactersBackup")
local TeleportService = game:GetService("TeleportService")
game:GetService("Players").PlayerAdded:Connect(function(Player)
local DataStore2Characters = DataStore2("Characters", Player)
local CharacterData2and1
local CharacterData3
local Success, Error = pcall(function()
CharacterData3 = DataStore2Characters:GetTable({
Characters = {""},
EquippedCharacter = "",
leaderstats = {{Points = 50}}
})
end)
local Success, Error = pcall(function()
CharacterData2and1 = CharactersDataStore:GetAsync(Player.UserId)
end)
if Error then
error(Error)
end
CharactersDataStore:RemoveAsync(Player.UserId)
local success, output = pcall(function()
DataStore2Characters:Set(CharacterData2and1)
end)
if not success then
error(output)
end
print(DataStore2Characters:GetTable({
Characters = {""},
EquippedCharacter = "",
leaderstats = {{Points = 50}}
}).EquippedCharacter)
print(DataStore2Characters:GetTable({
Characters = {""},
EquippedCharacter = "",
leaderstats = {{Points = 50}}
}).Characters[1])
TeleportService:Teleport(6871053299, Player)
end)