Pretty much this is a RemoteEvent Script for Purchasing a bag from the shop, works but cannot find the Backpack on line 13
local attached = game.ReplicatedStorage.Events.Attached
local function attach(player)
local stats = player.Bags
local coins = player.leaderstats:FindFirstChild("????Coins")
-- Variables
local character = script.Parent:FindFirstChild(player)
local backpack = "Backpack"
--
wait()
if stats.Equipped.Value == 1 then
coins.Value = coins.Value - 500
local oldbag = character:FindFirstChild(backpack)
oldbag:Destroy()
local torso = script.Parent:WaitForChild(player).Attach
local weld = Instance.new("Weld")
local clone = game.ReplicatedStorage.Backpacks.Backpacklvl2:Clone()
clone.Parent = character
clone.Name = "Backpack"
weld.Parent = clone
clone.Bag.CFrame = character.Attach.CFrame * CFrame.Angles(-165, math.pi, 55)
weld.Part0 = clone.Bag
weld.C0 = clone.Bag.CFrame:inverse()
weld.Part1 = torso
weld.C1 = torso.CFrame:inverse()
clone.Bag.CanCollide = false
end
end
attached.OnServerEvent:Connect(attach)

2 comments
That was the solution, thank you.
If you don't mind, please accept my answer; it'll help us both out