Hello,
It stops working at :GetAsync(key) command and dosen’t prints the statements the output dosen’t shows any error. Here my script:
001 | local DS = game:GetService( "DataStoreService" ) |
003 | local PetDS = DS:GetDataStore( "PetDataStore1" ) |
005 | local PetDSValues = DS:GetDataStore( "PetDataStore2" ) |
011 | local AUTOSAVE_INTERVAL = 60 |
015 | game.Players.PlayerAdded:Connect( function (Player) |
023 | local PetsFolder = Instance.new( "Folder" ) |
025 | PetsFolder.Name = "Pets" |
029 | PetsFolder.Parent = Player |
031 | local key = Player.UserId |
033 | PetsTable:GetAsync(key) |
037 | PetsValue:GetAsync(key) |
047 | local EncodedPetsTable = game.HttpService:JSONDecode(PetsTable) |
049 | local EncodedValueTable = game.HttpService:JSONDecode(PetsValue) |
051 | for _,p in pairs (EncodedPetsTable) do |
053 | local I = Instance.new( "IntValue" ) |
055 | I.Name = EncodedPetsTable [ p ] |
057 | I.Value = EncodedValueTable [ p ] |
075 | game.Players.PlayerRemoving:Connect( function (Player) |
079 | local key = Player.UserId |
085 | for _,p in pairs (Player.Pets:GetChildren()) do |
087 | table.insert(PetsTable, p.Name) |
089 | table.insert(PetsValue, p.Value) |
093 | PetsTable = game.HttpService:JSONEncode(PetsTable) |
095 | PetsValue = game.HttpService:JSONEncode(PetsValue) |
101 | PetDS:SetAsync(key, PetsTable) |
103 | PetDSValues:SetAsync(key, PetsValue) |
Thanks for answers!