You see the keyword there? “Model” To make all parts transparent with collisions off - Just loop through the model.
(Also define the Gate as it’s own variable, pleasee!!!)
for _,v in pairs(Gate:GetChildren()) do
if v.ClassName == "Part" or v.ClassName == "MeshPart" then
-- Other code here, but instead of script.Parent.Parent.Parent do "v.CanCollide"
end
end
Please also read up on this, it will help you a bunch!
Based of the screenshot here’s a messy example of what the script could be:
local Gate = script.Parent.Parent.Parent -- Defines the gate (very messy lol)
script.Parent.MouseClick:Connect(function()
for _,v in pairs(Gate:GetChildren()) do -- Loops through the gates children
if v.ClassName == "Part" or v.ClassName == "MeshPart" then -- If the child is a part or a meshpart
v.Transparency = 1 -- Make the child invisible and turn the cancollide off
v.CanCollide = false
end
end
end)