My code:
PlacePrompt.Triggered:Connect(function()
if TNTHeld.Value == true then
print("Placing TNT")
--false is sent to request clients to close gui
UIRemote:FireAllClients(false)
local TNTPCFrame = PH.CFrame.Position
TNT.CFrame = CFrame.new(TNTPCFrame)
PH.Transparency = 1
TNT.Transparency = 0
wait(5)
local explosion = Instance.new("Explosion")
explosion.BlastPressure = 10000000
explosion.BlastRadius = 30
explosion.Position = Vector3.new(-185.713, 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
Instance.new("Fire", v)
end
wait(1)
print("Action 2")
for i,v in pairs(parts) do
v.Color = Color3.new(0.168627, 0.168627, 0.168627)
end
else
print("I need TNT to place")
end
end)
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?