ID:179958
 
I have a mob that when you talk to her, she asks if you want to refill your magic points to max, at a little fee of course, but i cant get it to where if you dont have enough to pay the fee, she says something else, heres the code...

mob
SoothSayer
verb
Replenish()
set src in oview(1)
switch(input(" Do you Want your Magic Points to be replenished?","Replenisher",in list("Yes"),("No")
if("Yes")
usr << "ABRAKADABRA"
usr.MagicPoints = usr.MaxMagicPoints
usr.Gold -= 50
else // line of the error
usr << "You dont have enought money...Get Out!
if("No")
usr << "Good luck warrior."

Heres the error, error::expected "if" or "else"

What duz that mean? how can i fix it....Thank you
Please keep in mind that i didnt copy and paste it into here, when i did, it was too hard to read, so i rewrote it, if you spot some other error, like spelling or something, its not like that in my coding.
RayJack wrote:
I have a mob that when you talk to her, she asks if you want to refill your magic points to max, at a little fee of course, but i cant get it to where if you dont have enough to pay the fee, she says something else, heres the code...

mob
SoothSayer
verb
Replenish()
set src in oview(1)
switch(input("<font color = blue> Do you Want your Magic Points to be replenished?","Replenisher",in list("Yes"),("No")
if("Yes")
<font color=red>if(usr.Gold>=50)
usr << "ABRAKADABRA"
usr.MagicPoints = usr.MaxMagicPoints
usr.Gold -= 50</font>
else
usr << "You dont have enought money...Get Out!
if("No")
usr << "Good luck warrior."

Heres the error, error::expected "if" or "else"

What duz that mean? how can i fix it....Thank you
Please keep in mind that i didnt copy and paste it into here, when i did, it was too hard to read, so i rewrote it, if you spot some other error, like spelling or something, its not like that in my coding.</font>


I rewrote your code to fit to do what you want it to do.
The problem was that you didn't have anything being checked under the if("Yes") and when I put the if(usr.Money>=50) under the if("Yes") it check the Money when yes was selected.
PS-Close your html tags.
In response to Nadrew
Nadrew wrote:
I rewrote your code to fit to do what you want it to do.

Yes, but is he any wise on this? No, he simply has working code. Does he know what to do if in the future he gets the same error? No, so really you didnt solve anything you just temporarily postponed it.

Alathon
In response to Nadrew
Thanx a lot nadrew....You hepled me out.

Yes, he did just give me the solution, but i can learn from it....and i have. Thank you.