Hey, I'm actually working on a shopGUI which has the {Player} purchase a new Tool then afterwards it removes the current Tool in their Backpack and StarterGear then replaces it with the new Tool, however, whenever the {Player} resets, the old Tool comes back!
local magicTools = shopItems[purchasedItem][purchasedItem]:Clone() magicTools.Parent = player.Backpack local oldMagicTool = player.Backpack:FindFirstChildOfClass("Tool") oldMagicTool:Destroy() local magicTools = shopItems[purchasedItem][purchasedItem]:Clone() magicTools.Parent = player.StarterGear local oldMagicTool = player.StarterGear:FindFirstChildOfClass("Tool") oldMagicTool:Destroy()
The code above has "magicTools" assign the new tool purchased (which works just fine) then deletes the "oldMagicTool" (which also works just fine..) but as I said earlier, whenever the {Player} resets, the "oldMagicTool" comes back and the "magicTools" is gone.
I actually have the "tempFire" (which is the "oldMagicTool") inside of StarterPack and "tempLightning" inside of ServerStorage if any of this is helpful!
I'd appreciate any support I can get. :)
In your 8th line you're setting the parent to StarterGear, this makes it so that every time you respawn, you get that gear, try Backpack instead
local magicTools = shopItems[purchasedItem][purchasedItem]:Clone() magicTools.Parent = player.Backpack local oldMagicTool = player.Backpack:FindFirstChildOfClass("Tool") oldMagicTool:Destroy() local magicTools = shopItems[purchasedItem][purchasedItem]:Clone() local magicTools2 = shopItems[purchasedItem][purchasedItem]:Clone() magicTools.Parent = player.StarterGear magicTools.Parent = player.Backpack local oldMagicTool = player.StarterGear:FindFirstChildOfClass("Tool") oldMagicTool:Destroy()