Ok, so i made a button gui when you would press it a model would attach on the player now i want the script to delete the item when the button gui is pressed again I really don't know what to do.
button = script.Parent.TextButton
local vc = game.ReplicatedStorage["Rig BP"]
local plr = script.Parent.Parent.Parent
local char = plr.character or plr.CharacterAdded:Wait()
button.MouseButton1Down:Connect(function()
local Clonedvc = vc:Clone()
Clonedvc.Parent = char
Clonedvc:SetPrimaryPartCFrame(char:WaitForChild("UpperTorso").CFrame)
Clonedvc:SetPrimaryPartCFrame(Clonedvc:GetPrimaryPartCFrame() * CFrame.new(0,-.84,.02) * CFrame.Angles(6.28,3.14,0))
local Weld = Instance.new("WeldConstraint")
Weld.Part0 = Clonedvc.Main
Weld.Part1 = char:WaitForChild("UpperTorso")
Weld.Parent = char:WaitForChild("UpperTorso")
end)

3 comments
and like if its on the player = true then :destroy()
so basically you are saying that once when you have clicked you want that attached and second time when clicked you want it to destroy?
yes