ID:166519
 
Hello I realise I posted this a while ago, but here it is..

I have had this problem for a while now and it's really racking my brain, so here it is..:

I want to make an action example pick up something or other, example, lift weights, punch a bag etc, but I can make that, but how would I make it so the chracter freezes when making these actions, I have made it so I press lift and the weight moves up and down as if he was lifting and when I click lift again it stops, But for some reason my character can still move around and the weights keep going up and down.


I have tried many demos to usr.movement_lock = 1 or something or other and the other one which was, "usr.move=1"

Could anyone kindly give me some help please?


Sorry for being a pain...
mob/Move()
if(move)
..()
else
return

If move will be 1 or more, player will be able to move, if it will be 0 or null, player won't be able to move
In response to Ripiz
How would I put this code into what I have already, sorry I am still a begginer coder..

 obj
icon='Test Tube.dmi'
icon_state="weights"
layer=MOB_LAYER+1
verb
Lift()
set category="Action"
set src in oview(0)
if(usr.lifting==1)
usr.lifting=0
icon_state="weights"



else
usr << "You start lifting"
icon_state="lifting weight"
usr.lifting=1
AGAIN
if(usr.lifting==0)
return

else
var/random=rand(0.85,0.90)
var/stam=rand(1,2)
usr.strength+=random
usr.stamina-=stam
sleep(10)
goto AGAIN
In response to Nexus6669
mob/Move()
if(lifting)return 0
return ..()
obj
icon='Test Tube.dmi'
icon_state="weights"
layer=MOB_LAYER+1
verb
Lift()
set category="Action"
set src in oview(0)
if(usr.lifting)
usr.lifting=0
icon_state="weights"
else
usr << "You start lifting"
icon_state="lifting weight"
usr.lifting=1
AGAIN
if(!usr.lifting)return
else
var/random=rand(0.85,0.90)
var/stam=rand(1,2)
usr.strength+=random
usr.stamina-=stam
sleep(10)
goto AGAIN


And please, don't make a DBZ game, Naruto game or rip other people's code. Espessially the latter.

-- Data
In response to Android Data
Ok thank you alot, you have been most helpfull :)