proc/SellItems(var/obj/Items/O in usr)//the Sell verb, it lets you pick an object from your inv
var/list/L[1]//L is a list with the value of 1
var/C = 1
for(var/obj/M in usr.contents)//loop through all the things in your inventory
//if found
L[C] = M//the list L has the value of c and the mob is being added
C++//make room for another mob if more than one mobs in world
L.len++
var/M = (input("What to sell?")as null|anything in L)//makes it so if theres one mob, it doesnt automaticly choose the mob wich is its defualt operation
usr<<"You sold [M] for Gil"//usr.Gil += O.sellcost // for [O.sellcost]
del(M)
Problem description:
My Problem with this is that, it doesnt give the usr its gil that it soley diserves, instead it gives me a run time error, if i change it to M.sellcost, it claims that it does not exist...any idea's out there?