ID:264062
 
Code:
    if(usr.Kaguya&&src.Mtai >=50)
usr << "<B><font color = blue>You learned how to develop a sword out of bones!"
usr.verbs += new /mob/kaguyajutsu/verb/CreateBoneSword()
else
usr<<"You need 50 Tai to learn Bone Sword No Jutsu."


Problem description:
I know the indentation might be wrong but i but the code does not work when i talk the the person when i get my tai to 50 he says that i dont have enough tai if i need more than the but the whole begging of it tell me but

try
if(usr.Kaguya&&src.Mtai >= 49)
In response to Choka
hmm, well, that looks like it should work with it being >= 49, because the other code says "less than or equal to 50", meaning you need 51 to learn that. I'm 13 and i understand that... weird
Mr. Chex wrote:
Code:
>     if(usr.Kaguya&&src.Mtai >=50)
> usr << "<B><font color = blue>You learned how to develop a sword out of bones!"
> usr.verbs += new /mob/kaguyajutsu/verb/CreateBoneSword()
> else
> usr<<"You need 50 Tai to learn Bone Sword No Jutsu."

Problem description:
I know the indentation might be wrong but i but the code does not work when i talk the the person when i get my tai to 50 he says that i dont have enough tai if i need more than the but the whole begging of it tell me but


Assuming this is in a verb (if it is a proc, you need to ditch the usr abuse pronto), usr refers to the player in this case, and src is the source of the verb. So if this is a verb and you're using something like "set src in oview(1)", src will refer to the mob that the verb is defined under. This means that you are checking that mob's "tai" variable instead of the player's.
In response to Lureman
I tried it with 49 still does not work
In response to Lureman
Lureman wrote:
hmm, well, that looks like it should work with it being >= 49, because the other code says "less than or equal to 50", meaning you need 51 to learn that.

Actually, ">= 50" means greater than equal to 50, which is what he wants. Changing it to 49 does nothing except that it would allow 49 as an acceptable value.

As Volte said, it needs to check usr.Mtai, not src.Mtai. Also, he should check that his usr.Kaguya value is not 0, since that's also included in the test, and if Kaguya is false then it will still say he needs to raise his tai.