I made a script that when the user presses a GUI button a image and a value are created, the first part works fine along with the part that hides the image again, but the value does not get destroyed.
local buttonID = ("A1") local pressedBefore = false script.Parent.MouseButton1Click:connect(function() local int = Instance.new("StringValue",game.Workspace.intHolder) int.Name = buttonID int.Value = buttonID if pressedBefore == false then print("building") script.Parent.ImageLabel.Visible = true pressedBefore = true elseif pressedBefore == true then print("removing") script.Parent.ImageLabel.Visible = false game.Workspace.intHolder[buttonID]:Destroy() --destroy value "A1" from intHolder (model) pressedBefore = false end end)