You can use transparency to make it disappear without making it delete.
Transparency Example:
Part = script.Parent.Part
local clickdetector = script.Parent:WaitForChild("ClickDetector")
clickdetector.MouseClick:Connect(function()
if Part.Transparency == 0 then
Part.Transparency = 1
elseif Part.Transparency == 1 then
Part.Transparency = 0
end)
You can use ClickDetector to do this, here’s a sample.
local Part = script.Parent --The part is the parent of the script right here, you can edit this variable to any part you want.
-- Create a ClickDetector in the Part
local ClickDetector = Instance.new("ClickDetector")
ClickDetector.Parent = Part
ClickDetector.MouseClick:Connect(function()
if Part.Transparency == 0 then
Part.Transparency = 1
else -- You can also use elseif if you want, but you don't have to in this case.
Part.Transparency = 0
end
end)