ID:146204
 
Code:
mob
verb
Meditate()
if(usr.med == 0)
src.icon_state ="meditate"
usr.doing =1
usr.meditate =1
usr.med =1
usr <<"You sit down and flow into a deep sleep."
usr.medit()
if(usr.meditate == 1 && usr.med ==1)
src.icon_state =""
usr.meditate =0
usr.med =0
usr.doing =0
usr.med = 0


Problem description:My code works fine but when they are meditating they are able to move. I tried putting move =0 thinking that its a built in var, but nothing will work.

Try something like this(Not really a code prob):
mob
var
locked = 0//locked var

mob
Move()//movement proc
if(src.locked)//if the person's locked var is 1, they cant move
return
else //otherwise, use the regular move proc
..()


Hope this helps
In response to Mecha Destroyer JD
k thanks 4 the help
In response to Animekid09
Just to give you some points, to "highten" this code...
mob
verb
Meditate()
if(usr.med)
src.icon_state ="meditate"
usr.doing=1
usr.meditate=1
usr.med=1
usr <<"You sit down and flow into a deep sleep."
usr.medit()
if(usr.meditate&&usr.med)
src.icon_state =""
usr.meditate=0
usr.med=0
usr.doing=0
usr.med=0
In response to Flame Sage
u only changed 1 thing that didn't need to be changed.
In response to Animekid09
i added everything and put it all together but the player can still move around. this is what i have;
mob
verb
Meditate()
if(usr.med == 0)
src.icon_state ="meditate"
usr.doing =1
usr.meditate =1
usr.med =1
usr <<"You sit down and flow into a deep sleep."
usr.medit()
if(usr.meditate == 1 && usr.med ==1)
src.icon_state =""
usr.meditate =0
usr.med =0
usr.doing =0
usr.med = 0
src.locked =0
Move()
mob
var
locked = 0//locked var

mob
Move()//movement proc
if(src.locked)//if the person's locked var is 1, they cant move
return
else //otherwise, use the regular move proc
..()

how to i make it so it stops the movement?
In response to Animekid09
mob
verb
Meditate()
if(usr.med == 0)
src.icon_state ="meditate"
usr.doing =1
usr.meditate =1
usr.med =1
usr <<"You sit down and flow into a deep sleep."
usr.medit()
if(usr.meditate == 1 && usr.med ==1)
src.icon_state =""
usr.meditate =0
usr.med =0
usr.doing =0
usr.med = 0
src.locked =1
Move()
mob
var
locked = 0//locked var

mob
Move()//movement proc
if(src.locked)//if the person's locked var is 1, they cant move
return
else //otherwise, use the regular move proc
..()

I think you had src.locked on the wrong value.
In response to RaditzX
i fixed it and you were right i had it in the wrong spot but so did you,
mob
verb
Meditate()
if(usr.med == 0)
src.icon_state ="meditate"
usr.doing =1
usr.meditate =1
usr.med =1
usr <<"You sit down and flow into a deep sleep."
src.locked =1
usr.medit()
if(usr.meditate == 1 && usr.med ==1)
src.icon_state =""
usr.meditate =0
usr.med =0
usr.doing =0
usr.med = 0
src.locked =0
Move()
mob
var
locked = 0//locked var

mob
Move()//movement proc
if(src.locked)//if the person's locked var is 1, they cant move
return
else //otherwise, use the regular move proc
..()




mob
proc
medit()
if(usr.meditate == 1)
usr.mpl +=rand(1,3)
sleep(35)
src.locked =1
Move()
usr.medit()
mob/var/med =0