ID:149445
 
how to make somebody stop in their position.
Try this.

mob
var
lock = 0
verb
Lock(mob/M as mob in world)
if(!M.lock)
M.lock = 1
else
M.lock = 0
Move()
if(src.lock)
return ..()
else
..()

DarkTitan
In response to DarkTitan
DarkTitan wrote:
Try this.

mob
var
lock = 0
verb
Lock(mob/M as mob in world)
if(!M.lock)
M.lock = 1
else
M.lock = 0
Move()
if(src.lock)
return ..()
else
..()

DarkTitan


Thats a good start, but change this line

if(src.lock)
return 0

that lets them not move
In response to Sariat
Actually that code is totally tested:) It works just fine.

DarkTitan
In response to DarkTitan
DarkTitan wrote:
Actually that code is totally tested:) It works just fine.

DarkTitan

return 0 looks better to me :P
In response to Sariat
Wait a sec your right the code I have when I checked did include returning 0 hehe my bad :p
In response to DarkTitan
I need it as a proc though. It's for a stamina thing so they can't move until they have enough Stamina.
In response to Buzzyboy
Buzzyboy wrote:
I need it as a proc though. It's for a stamina thing so they can't move until they have enough Stamina.

Just change the loc var when you want them to be able to move or not move. My movement library has the same feature, except to loc the movement you do move_LockDown() or move_UnlockDown().
In response to Ebonshadow
thats too confusing I already tried it
mob/var/locked = 0 //define this so everybody is born unlocked
mob/Move()//when the mob moves
if(usr.locked == 1)//if it is locked
return 0//he cant move
else//if he is not
..()//go on with life
mob/verb/stopmoving(var/mob/M in world)//pick a mob in the world
if(M == usr)//if you are the mob that was chosen
usr << "You can't do this to yourself!"//you cant do this to yourself
..()//go on with life
else//if someone else
M.locked = 1//the mob you selected is locked


I hope you learned something!