local function SpawnPillars()
while true do
if dead == true then
print("break")
break
end
local Points = MakePillar()
for i = 1, #Points do
tweenPart(Points[i], 15, {Position = Points[i].Position - Vector3.new(60,0,0)}, true)
end
wait(waitTime)
end
end
At the beginning of the loop I wrote an if condition to check if dead is true or not, but it only checks after the wait(waitTime) at the end, which means it only checks every 3.5 seconds. I want the loop to repeat every 3.5 seconds but I also want to break it immediately when dead is true, not after 3.5 seconds. Any solution?

2 comments
To answer your question on my post, I believe it will break out of the for loop, however I used that method because the for loop is placed at the end of the while true do loop, meaning that the second that for loop ends the while loop will repeat.
oh thanks, i just want to tell u that i found a solution so i will use my method