verb
Sell()
set src in oview(1)
switch(input("dude can i buy an engine from you.")in list("Yes","Buy your own"))
if("Yes")
usr.hp -= 10
usr.cash+=120
alert("Let me take your engine.")
if("Buy your own")
alert("Come back if you want to give me the engine.")
can you show me how to fix it with code. i will change what you right so it matches my code.
ID:261407
Feb 22 2002, 6:24 pm
|
|
Feb 22 2002, 6:27 pm
|
|
whats wrong with it? you might wont to put usr. befor your alerts.
|
You don't check for the object. You need to look in the usr's contents for the object, then if you find it, remove/move it.
Look up: contents Find Move |
Knuckles skater wrote:
verb Sell() set src in oview(1) switch(input("dude can i buy an engine from you.")in list("Yes","Buy your own")) if("Yes") usr.hp -= 10 usr.cash+=120 alert("Let me take your engine.") if("Buy your own") alert("Come back if you want to give me the engine.") ------------------------------------------------------------ put <font color=blue>return</font color=blue> at the end. |
In response to Non-PC
|
|
That won't make a difference. Procs and verbs terminate themselves once they reach the end, the only time you need to use return is to exit a proc or verb prematurely or if you need to return a value to the proc or verb that called that proc or verb.
|