ID:1857939
 
(See the best response by Nadrew.)
Code:
            Push
verb/Push()
set category = "Skills"
set name = "Push"
var/S = new/obj/Airskills/Shockwave
if(usr.Meditate == 0)
if(usr.Cooldown ==0)
view(8) << "<b>[usr]: Air Push"
usr.Cooldown = 1
S:loc= locate (src.x,src.y,src.z)
spawn(3)
del S
for(var/mob/M in oview(3))
walk_away(M,src,5)
sleep(5)
walk(M,src,0)
sleep(10)
usr.Cooldown = 0


Problem description:
So the problem here is I want the ability to be able to push everybody around me at the same time. Because this code at the moment will push everybody out but it will go in some order.

Best response
The way a loop works is that it will wait for the code within one iteration to complete before it moves on to the next. If you want it to move on right away you need to make it think the code within it has finished. This is accomplished with the spawn() proc.

for(var/mob/M in oview(3))
spawn(1)
// Your code here


You can also avoid the usage of : in your code by type-casting your 'S' variable.

var/obj/Airskills/Shockwave/S


Annnd, your current usage of "spawn(3)" actually does nothing, spawn() doesn't work like sleep(), if you want to delay the code beneath it it has to be indented beneath the spawn() call.

spawn(3)
del S
// Wrong

spawn(3)
del S
// Right


And as just one more thing, you don't really need to use "== 0" in your if(), you can simply use the ! operator.

if(!usr.Cooldown)


You should probably also close your HTML tag.

view(8) << "<b>[usr]: Air Push</b>"
Oh so I was missing the spawn(1)! hahaha
And thank you for correcting all my other mistakes.

It works now :)