ID:166425
 
Hello for some reason My code works to how I want it to a certain extent. My reason for this post is because obviously my code has problems of course.....


 obj
speed

verb
Punch()
set category = "Training"
set src in oview(1)
if (usr.resting)
usr<<"Not while resting"
return
if (usr.meditate)
usr.random=0
usr<<"Not while meditating"
return

if (usr.resting)
usr.random=0
usr<<"Not while resting"
return


if(usr.stamina >= 5)
if(usr.dir == 4)
flick("speed hit",src)
usr.random = rand(1,12)
usr.icon_state="punch"
if(usr.random == 6)
usr.move = 1
usr.stamina-= rand(5,10)
usr.icon_state = "punch"
usr.speed += rand(0.80,0.85)
if(usr.random == 11)
usr.move = 1
usr.stamina-= rand(5,10)
usr.icon_state="punch"
usr.speed += rand(0.85,0.90)

else
usr.speed += 0
else
usr << "Please Face the bag.."
else
usr << "Out of Stamina"



The problem is, my code works to how I want it, the speed back action and animation works, but my character does not punch, he just stands still why the speed bag moves like how it's meant too.

How comes my usr.icon_state="punch" is not making my character punch his arm out??



Thank you..
Instead of changing their icon state, make the usr flick just like the bag except with punch. Also, post code problems under Code Ppoblems..0_0

flick("punch",usr)
In response to Mecha Destroyer JD
Sorry, my mistake, i've also tried the flick idea like bag, still nothing, my character just turns invisible and when the action is finished he returns....

What could be the problem, could it be the icon??


Because as for the icon, I've got it so it's just 4 different type of punch angles, North,South,East and West.

Why should this be a problem..