I'm trying to make a script that has a model become visible when you click a brick with a ClickDetector, then after 12 seconds it disappears. How do I make it so that I can click the block and it re-appears? I tried changing it a lot, but nothing worked.
visible = true script.Parent.ClickDetector.MouseClick:connect(function() if visible == true then for i,v in pairs(script.Parent.Parent["SampleName"]:GetChildren()) do v.Transparency = 0 -- 1 is for completely invisible v.CanCollide = true visible = true end end wait(12) --this is used to make it disappear again 12 seconds after the lines above were ran for i, v in pairs(script.Parent.Parent["SampleName"]:GetChildren()) do v.Transparency = 1 v.CanCollide = false visible = false end end) --trying to get it so that after i click the brick, i can come back, click it again, and it works. it doesn't no matter how much i try to change the script to work.