ID:261265
 
Hello. I'm trying to make it so that only a certain item is deleted from the usr's contents. Example.

mob
King
verb
Speak()
set src in oview(1)
if(usr.Fleece == 1)
alert("Thank you! You shall revieve a great reward!")
usr.contents -= new/obj/Fleece
else
alert("You have not what I need.")

mob/King
icon = 'Grass.dmi'

When the person picks up the fleece, their fleece var ='s
one. I want it so that when they talk to the king when their fleece var is 1, the fleece is deleted from their inventory. What am I doing wrong?
When the person picks up the fleece, their fleece var ='s
one. I want it so that when they talk to the king when their fleece var is 1, the fleece is deleted from their inventory. What am I doing wrong?

You don't need to keep track of a "fleece" var at all. If it's in the usr's contents, the king can search for it there:

var/obj/fleece/F = locate() in usr.contents
if(F) del F
In response to Gughunter
Thank you GugHunter.