ID:146542
 
Code:
mob/shop
icon = 'pc.dmi'
var
items = list()
verb
Shop()
set src in oview(1)
set category = null
var/tmp/type = input("What would you like to buy?","Shop") as anything in items+list("Cancel")
if(type == "Cancel")
alert("Be sure to come again", "[name]")
if(type == "Wooden Sword")
var/tmp/obj/Inventory/Equipment/Weapon/Swords/wood/I = new()
usr << "[desc]"
switch(alert("Are you willing to pay [I.value] for this fine item?", "[name]", "Yes","No"))
if("Yes")
I.Move(usr)


Shop1
name = "Leland Gaunt"
items = list("Wooden Sword", "Wooden Shield")


Problem description:
The above code is a basic shop sorta thing, I'll make it more complex when it's complete. However it refuses to work... it keeps saying (when I compile) that I.value hasn't been defined, despite the fact that it clearly has been.
M'aidez s'il vous plait.
I is defined under the if statement, so is only accessable there.

Take a look at Spuzzum's Shopkeeper demo to get you started off a little better:http://developer.byond.com/hub/Spuzzum/AlternateShopKeeper