ID:150167
 
ok, I want to make it so that when someone is blocking and attack the damage is /2 and When they are doing this other move(not sure what its called yet) no damage comes at all. Now i'm kind of a newbiew at this so try to be discriptave with your help, and yes I have read everything on the byond thing so please don't tell me to do that. Thanks
Something like this (which is in simplified form) should be what you're looking for.
mob/var/blocking = 0
mob/var/damage = 10
mob/var/health = 100

mob/verb/Block()
if(src.blocking)
src.blocking = 0
src << "You lower your guard."
else
src.blocking = 1
src << "You raise your guard."

mob/verb/Attack(mob/M in orange(1))
src << "You attack [M]!"
M << "[src] attacks you!"
oview() << "[src] attacks [M]!"
if(M.blocking) // This is the part you want.
M.health -= (src.damage/2)
else
M.health -= src.damage

In response to GateGuardian
would I make the code wrong if I used usr.ect instead of src because I do that all the way throughout my code , and thanks.
In response to BrollyX
In response to BrollyX
Yes, it would make a difference.

As the last message suggested, you should look up the difference to find out why I'm using src instead of usr.
In response to Evilkevkev
thanks for all the help. I have a few more questions. Do you know how to create a mob in front of an existing player and how to make a sort of gang of computers walk around together and fight anyone they come across?? I am not very familiar with AI so if you run across anything that talks about that please let me know.
In response to BrollyX
Yea if you guys could help me out with pretty much the same things, probable because we are related.
In response to SaiyanX
k, first don't pay any attention to saiyanx he is a moron , and always copies me, second I realy need help with my last post. plz help me.
In response to BrollyX
k, i have a question for the following

thanks for all the help. I have a few more questions. Do you know how to create a mob in front of an existing player and how to make a sort of gang of computers walk around together and fight anyone they come across?? I am not very familiar with AI so if you run across anything that talks about that please let me know.
In response to BrollyX
BrollyX wrote:
k, i have a question for the following

thanks for all the help. I have a few more questions. Do you know how to create a mob in front of an existing player and how to make a sort of gang of computers walk around together and fight anyone they come across?? I am not very familiar with AI so if you run across anything that talks about that please let me know.

You guys I will shut up if you plz help me with this ppleazzzzzzze