mob/monsters/animals/cow
var/justmilked = 0
icon='players1.dmi'
icon_state = "cow"
name = "Cow"
verb
Milk()
set src in oview(1)
for(usr.contents)
if(src.type == /obj/item/bottle)
del(src)
new /obj/item/drinks/milk(usr.loc)
usr << "You milked a cow!"
justmilked=1
break()
else
justmilked = 0
if (justmilked == 0)
usr << "Milk spills everywhere. You need a bottle silly!"
ID:179060
![]() Feb 22 2002, 2:35 pm
|
|
How do I search the inventory for an item?
|
Try for(var/obj/O as obj in usr) instead. Don't use usr.contents, just use usr. Try to avoid the use of usr as much as possible, since it's very unstable as to who usr is.