Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Why isnt the last bit of code executing?

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) 

1 answer

I think it is because earlier in the script you never defined lol

2 comments

0

Well im basically declaring it there, and even without that line of code, it still wont work.

0

Well, you need the line there because don't you need the ClickDetector to make the brick(s) turn Transparency to 0?

This discussion is preserved as it was. New answers, comments, and votes are closed.