By triggering via /scriptcommand, I wanted a loop to run a function, briefly pause, and then continue the loop again.
while (pNumber < sPspawn.length) {
pNumber++
projectileSpread(sourceEntity, sbEntity, pNumber, sPspawn, view, radius, speed)
system.runTimeout(() => { }, 5)
}```
Instead, the code works, but goes through the loop instantly, as if the timeout isn't even there.
How do you put a delay inbetween each loop?