mob
proc
Jelly_Legs()
usr.random=rand(1,4)
if(usr.random==1)
usr.dir=NORTH
if(usr.random==2)
usr.dir=SOUTH
if(usr.random==3)
usr.dir=WEST
if(usr.random==4)
usr.dir=EAST
spawn() Jelly_Legs()
Problem description:
How can I stop this spawn within like 40 sec
Instead of using all those ifs, you can just use one switch statement:
For this example, though, we don't even need to go that far:
The above eliminates all those if statements, and doesn't require that every mob have a variable called "random".
To make sure that your proc stops after 40 seconds, we can make a loop and put in some sleep statements:
That will change the mob's direction once ever second for 40 changes, or a total of 40 seconds. If you're not familiar with the use of any of those procs, you should look them up in the DM reference.