I have the save backpack working but I used a tutorial that actually worked perfectly the first try. There's only one small issue, when the player dies, any weapon that was purchased gets destroyed and upon respawn there is an extra starter pistol.
How do I make players keep inventory even when they die?
char.Humanoid.Died:Connect(function() char.Humanoid:UnequipTools() local old = player.StarterGear:GetChildren() for i = 1, #old do old[i]:Destroy() end local new = player.Backpack:GetChildren() for i = 1, #new do new[i].Parent = player.StarterGear end end)
Here is the function I believe is the reason for some weird stuff happening.
Again this tutorial worked, which is great, but now I'm not really sure what I'm looking at. Can anyone explain why this issue is happening? Thanks!
local new = player.Backpack:GetChildren() local newClone = new:Clone( for i = 1, #new do newClone[i].Parent = player.StarterGear end
idk if it would work didnt tested it please dont leave hate comments