Hi, I want to make doors. I made a script that opens the door when a sign is clicked. The clickdetector and the script is inside the sign. They both are supposed to make another model inivisble. Can you tell me the issue with this code?
function onClicked()
local children = game.Workspace.tardis1door:GetChildren()
for c = 1, #children do
if children[c].className == ""
then children.Transparency= 1
children.CanCollide = false
wait(5)
children.Transparency= 0
children.CanCollide = true
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
Thanks

1 comment
To add to what Nifer said: You may run into the problem that 'className' is nil. If this happens, do 'ClassName' instead.