In my previous question, I asked on how I would make sure a tool will always remain in the player's inventory even after death.
The solution someone gave me was to use :WaitForChild('StarterGear').
This is my shop script, which is a LocalScript in an ImageButton.
script.Parent.MouseEnter:Connect(function()
game.StarterPlayer.Mouse_hover:Play()
end)
local canPurchase = false
script.Parent.MouseButton1Click:Connect(function()
game.StarterPlayer.Select:Play()
local confirmPurchase = script.Parent.Parent.Parent.ConfirmPurchase:Clone()
confirmPurchase.Visible = true
confirmPurchase.Parent = script.Parent.Parent.Parent
confirmPurchase.Yes.MouseButton1Click:Connect(function()
canPurchase = true
if game.Players.LocalPlayer:WaitForChild('leaderstats').Vertigo.Value >= 25000 then
game.StarterPlayer.SFX_SelectAvailable:Play()
game.Players.LocalPlayer:WaitForChild('leaderstats').Vertigo.Value = game.Players.LocalPlayer:WaitForChild('leaderstats').Vertigo.Value - 10000
local itemClone = game.ReplicatedStorage.Guns.Sniper:Clone()
itemClone.Parent = game.Players.LocalPlayer.Backpack
local itemClone2 = game.ReplicatedStorage.Guns.Sniper:Clone()
itemClone2.Parent = game.Players.LocalPlayer:WaitForChild('StarterGear')
game.ReplicatedStorage.Purchased:FireServer(25000)
confirmPurchase:remove()
canPurchase = false
else
game.ReplicatedStorage.NotEnoughVertigo:FireServer()
end
end)
end)
Terribly sorry if it's hard to read, it's the formatting.
Can anyone help me fix this issue? I've had it for a very long time.
Regards, Sensei.

2 comments
Instead of saving numbers, bools and stings, is it possible to save objects by simply putting in ExampleStore:SetAsync("Player",object)?
No, since an ObjectValue just stores a link of sorts to an object and objects are not persistent between sessions. Even though you aren’t exactly storing between sessions DataStores are designed to.