Hello, I would like to know how do I remove clones from the tool in the backpack, for example, once I already have the item, when I click to buy an object it is cloning in the back pack. Could someone help me?
function buy()
if script.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Level.Value >= 45000 then
script.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Level.Value = script.Parent.Parent.Parent.Parent.Parent.Parent.leaderstats.Level.Value-0
local clone1 = game.ServerStorage.Sword:Clone()
clone1.Parent = script.Parent.Parent.Parent.Parent.Parent.Parent.Backpack
end
end
script.Parent.MouseButton1Down:connect(buy)

1 comment
you should use variables, instead of saying "script.Parent.Parent.Parent.Parent.Parent.Parent.Parent" and so on