So this script works PERFECTLY fine, until the last bit of code. Anything written behind line 26 won't execute. The output shows no errors, It just doesnt do anything. So basically I just want the last bit to execute when the for statement over it has changed each brick's transparency to 0.
allmehtraps = game.Workspace.traps a = {allmehtraps.Part1,allmehtraps.Part2,allmehtraps.Part3,allmehtraps.Part4} butt = script.Parent script.Parent.ClickDetector.MouseClick:connect(function() butt.BrickColor = BrickColor.new("Really red") butt.ClickDetector:Destroy() for i,v in pairs(a) do for i = 0,1, 0.1 do wait(.15) v.Transparency = i if v.Transparency == 1 then v.CanCollide = false end end end wait(20) for i,v in pairs(a) do if v.CanCollide == false then for i = 1,0, -0.1 do wait(.075) v.Transparency = i end if v.Transparency == 0 then v.CanCollide = true butt.BrickColor = BrickColor.new("Bright green") lol = Instance.new("ClickDetector",script.Parent) end end end end)
I think it is because earlier in the script you never defined lol