Hi I was wondering why this piece of code wont work?
local datastore = game:GetService("DataStoreService"):GetDataStore("Stats")
game.Players.PlayerRemoving:connect(function(player)
player:WaitForDataReady()
datastore:SetAsync(player.Backpack:findFirstChild("Data"),player.Data.Value)
datastore:SetAsync(player.Backpack:findFirstChild("Type").Name,player.Type.Value)
datastore:SetAsync(player.Backpack:findFirstChild("Bp").Name,player.Bp.Value)
end)
game.Players.PlayerAdded:connect(function(newplayer)
newplayer:WaitForDataReady()
if datastore:GetAsync(newplayer.Backpack.Type.Value) ~= 0 then
Type.Value = datastore:GetAsync(newplayer.Backpack.Type.Value)
if datastore:GetAsync(newplayer.Backpack.Bp.Value) ~= "None" then
newplayer.Bp.Value = datastore:GetAsync(newplayer.Backpack.Bp.Value)
end
end
end)
Thanks

1 comment
No Data Is Just Something Im Keeping The Strings in