The if("Yes") statement says twice: error: if: missing comma ',' or right-paren ')'
mob
Shopkeeper
icon = 'shopkeeper.dmi'
density = 1
opacity = 1
Click()
set src in oview(1)
switch(alert("Do you want this finely-crafted sword? (note: this is a paid booster): Cost: 20 Gold",,"Yes","No"
if("Yes")
usr.Strength += 20
usr << "You get stronger from the mystical SWORD!"
usr.wealth -= 20
if("No")
usr << "Ahhhhhhhhhhhh... My sword must wait for the next greedy customer..."
ID:149125
Jul 1 2002, 3:15 am
|
|
In response to Shadowdarke
|
|
Shadowdarke wrote:
You are missing two parenthesis at the end of the switch line: Now, set src in oview(1) says oview: unidentified proc, and the alert now says error: missing expression. |
In response to Drafonis
|
|
The set src in oview(1) line does nothing within a Click() proc, and if it did all the lines below it would be indented one tab too far.
Leave the indentation as it is though, because you need to replace the set src line with an if(): if(get_dist(src,usr) <= 1) // make sure the person clicking is within 1 space. There are other problems in your shop code. For instance, you never make sure that the usr has enough money. You may want to examine some of the shopkeeper demos for a more robust system. |
In response to Shadowdarke
|
|
Shadowdarke wrote:
The set src in oview(1) line does nothing within a Click() proc, and if it did all the lines below it would be indented one tab too far. Thanks. I tried to find shopkeeper demos, but they're all either by verbs or were packaged as games, not tutorials. |
switch(alert("Do you want this finely-crafted sword? (note: this is a paid booster): Cost: 20 Gold",,"Yes","No"<font color=#ffffa0>))</font>