ID:174833
 
Someting is wrong with this, it wont respond or it gives me an error, can anyone look at this and point out my error?:

mob
proc
sale()
switch(input("What do you want to sell?")in list("Apple $50","Nothing"))
if("Apple")
var/obj/fruit/apple/Apple = locate(/obj/fruit/apple/Apple) in usr.contents
if(Apple)
usr.zenni += 50
usr.contents -= /obj/fruit/apple/Apple
alert("Thanks come again!")
else
alert("You have none to sell!")

Your indentation is messed up...The sutff after the if("Apple") part need to be one tab after it also it neeed to be "Apple $50" not just apple
Here is the sorted out version of your procedure.

mob
proc
sale()
switch(input("What do you want to sell?")in list("Apple $50","Nothing"))
if("Apple $50")
var/obj/fruit/apple/Apple = locate(/obj/fruit/apple/Apple) in usr.contents
usr.zenni += 50
usr.contents -= /obj/fruit/apple/Apple
alert("Thanks come again!")
else
alert("You have none to sell!")


--Lee
In response to Mellifluous
That wont work because it doesnt check if the item is in the inventory or not...
In response to Koolguy900095
Koolguy900095 wrote:
That wont work because it doesnt check if the item is in the inventory or not...

Did I say it was to help him out?

No, but in a way it does, not the way he wants it though.

What I said, and what I shall quote is here; "Here is the sorted out version of your procedure."

Don't go jumping on my neck when it is you who mis-read what I wrote.

--Lee