Make a Model Disapear

So, i feel super Stupid right now.

I try to make the Contents on the Table Disapear when you click that Block in the Middle, and i want it to Re-apear when you click the Block again. Basically Setting up a table and tidy it up.

With this Code:


local model = script.Parent.Parent.Parent.Gesteck -- your model (script.Parent.Parent in your current case)
local Indicator = script.Parent.Parent.INDICATOR
local descendants = model:GetDescendants() -- you can use :GetChildren() if there are not BaseParts parented to another BasePart


function Transparent()
	for i=1,#descendants do
		local descendant = descendants[i]
		if descendant:IsA("BasePart") then
			descendant.Transparency = 1
		end
	end
end

function Visible()
	for i=1,#descendants do
		local descendant = descendants[i]
		if descendant:IsA("BasePart") then
			descendant.Transparency = 0
		end
	end
end





Click.MouseClick:Connect(function()
	if Indicator.Transparency == 1 then
		Click.MouseClick:Connect(Visible())	
	else
		Click.MouseClick:Connect(Transparent())	
	end
end)

I’m still learning as i go. The Transparency Script worked in another Place already its the re-apearing Part i dont know how to do.
Strangely on Another Table with less Content on it, it Works fine but still says it cant call the Value.

Help is super appriciated. Thanks already and sorry if this is a Dumb Question.

Here’s an example:

local Model = script.Parent.Parent.Parent.Gesteck -- Your Model
local ClickPart = game.Workspace:WaitForChild("YourPartNameHere")  -- The block in the middle.
local Visible = false 

ClickPart.ClickDetector.MouseClick:Connect(function() -- Connect the Mouse clicking event to a function.
    if Visible == false then -- Check if the descendants are not visible
       visible == true 
       for i, v in pairs(model:GetDescendants()) do -- Gets all the descendants. (v = current object)
          if v:IsA("BasePart") then -- If the object is a BasePart, make it visible.
            v.Transparency = 0
          end
       end
    else
      Visible = false
      for i, v in pairs(model:GetDescendants()) do -- Same as the above, just makes the parts invisible.
         if v:IsA("BasePart") then
           v.Transparency = 1
         end
      end
    end
end)

More Info about for loops: Introduction to Scripting | Roblox Creator Documentation
More Info about events: RBXScriptSignal | Roblox Creator Documentation