ID:143588
 
Code:
obj
npc
creator
icon = 'yuramon.dmi'
icon_state = "rookie"
density = 1
DblClick(creator,Location)
var/crt = input("What do you want me to make?") in list("HP Potion","Cancel")
switch(crt)
if("HP Potion")
if(/obj/Items/Drops/Tanemon_Leaf in usr.contents >= 5)
new/obj/Items/Etc/HP_Potion
Move(usr)
if(usr.InventoryUp)
usr.CreateInventory()
else
usr << "You do not have the needed items!"

if("Cancel")
return


Problem description:
I want the creator to give me a "Potion" if I got over 5 tanemon leafs but I get error in game "type mismatch" and I don't see what's wrong :S

Also I use On-Screen inventory made by SSJ Radditz
I really need help with this >.<
obj
npc
creator
icon = 'yuramon.dmi'
icon_state = "rookie"
density = 1
DblClick(creator,Location)
var/crt = input("What do you want me to make?") in list("HP Potion","Cancel")
switch(crt)
if("HP Potion")
var/num
for(var/obj/Items/Drops/Tanemon_Leaf/T in usr)
num+=1
if(num >= 5)
new/obj/Items/Etc/HP_Potion(usr)
if(usr.InventoryUp)
usr.CreateInventory()
else
usr << "You do not have the needed items!"

if("Cancel")
return

If you just put Move(usr) there, the npc will move to the usr. You probably want the HP Potion to move to the usr, so look up new in the reference.
In response to Kaiochao2536
How do I make the Tanemon_Leaf subtract by 5 when I get the potion? I've tried with "num -= 5" but it won't work >.<
In response to Syltmunk
In the for() bit, under num+=1, put del(T).
In response to Hazman
lol that will just delete all tanemon leafs not 5.....and even if I don't have five it will delete them all....>_>
In response to Syltmunk
I have no clue what to do ;_;
In response to Syltmunk
bump