ID:2907351
 
Code:
    PoisonPotion
name="Poison Potion"
icon = 'magicitems.dmi'
icon_state="health_potion"
verb
Throw()
set src in usr
src.Thrown=1
src.owner = "[usr.key]"
walk(src,usr.dir,0)
sleep(20)
if(src)
usr.itemDrop(src)
for(var/mob/N in world)
for(var/obj/Potions/PoisonPotion/T in oview(20))
if(T:owner == "[N.key]")
if(src.Thrown)
del(T)
Bump(atom/M)
if(istype(M,/mob/))
if(M:shielded)
for(var/mob/N in world)
for(var/obj/Potions/PoisonPotion/T in world)
if(T:owner == "[N.key]")
if(T:Thrown)
del(T)
return
for(var/mob/N in world)
if(src.owner == "[N.key]")
N<<"You hit [M]!"
M<<"You were hit by [N]!"
M:Poison = 1
N.Poisoned(M)
N.DeathCheck(M)
for(var/obj/Potions/PoisonPotion/T in world)
if(T:owner == "[N.key]")
if(T:Thrown)
del(T)
return
else
for(var/mob/N in world)
for(var/obj/Potions/PoisonPotion/T in world)
if(T:owner == "[N.key]")
N<< "The [src] shatters when hitting the [M]"
if(T:Thrown)
del(T)
return


Problem description:
Helloooo so I'm trying to have this potion were once it's thrown it drops just 1 item from the inventory and and walks in the dir of the usr for 20 or until it bumps. For some reason it takes all poison potion out of my inventory regardless of how many I have so when you throw once it will take every single item of that potion you have. Thanks for any help!
Okay so I figured it out lol

        Throw()
src.Thrown=1
src.owner = "[usr.key]"
var/obj/Potions/PoisonPotion/A = new /obj/Potions/PoisonPotion
A.loc=usr.loc
walk(A,usr.dir,0)
usr.itemDrop(src)
sleep(15)
if(src)
for(var/mob/N in world)
for(var/obj/Potions/PoisonPotion/T in oview(20))
if(T:owner == "[N.key]" && src.Thrown)
del T

So for anyone else with this problem, I had to add the obj
var/obj/Potions/PoisonPotion/A = new /obj/Potions/PoisonPotion
and label it A so when I added the piece the makes it walk
walk(A,usr.dir,0)
it didn't take the src out of my inventory but the actual item now labeled "A". Hope that makes sense to another newbie like me reading this :D!