For i,v not moving on after wait

My code:

	if TNTHeld.Value == true then
		print("Placing TNT")
		--false is sent to request clients to close gui
		local TNTPCFrame = PH.CFrame.Position
		TNT.CFrame =
		PH.Transparency = 1
		TNT.Transparency = 0
		local explosion ="Explosion")
		explosion.BlastPressure = 10000000
		explosion.BlastRadius = 30
		explosion.Position =, 6.77, 586.069)
		explosion.Parent = game.Workspace
		Debris:AddItem(TNT, 0.01)
		local parts = game:GetService("Workspace").WIP_Map.Wall.WallBoom:GetChildren()
		print("Action 1")
		for i,v in pairs(parts) do"Fire", v)
		print("Action 2")
		for i,v in pairs(parts) do
			v.Color =, 0.168627, 0.168627)

		print("I need TNT to place")

My issue:
So we been trying to debug this issue for a while, but basically on the for i,v loops action 1 completes, however once it completes it will not go on to action 2. We tried removing the wait and thats what does it, however we kind of need the wait. Any suggestions?

for i,v in pairs(parts) do"Fire", v)

Try adding this and see if it just keeps printing “Working”

Also maybe switch from wait to task.wait as that’s good practice now.

It doesn’t keep printing. ahhhhhhh

So does print("Action 2") never get reached? Like does Action 2 show up in the output?

Odd behavior if so cause it should print unless something ends it early.

Task.wait fixed this issue LOL thank you so much

1 Like

Glad to hear it, make sure to switch every wait to task.wait as well.