ID:149976
 
im trying to use this code when you use an item(ill put "" around thisng i dont understand):
obj
Attackadders
kirbyfire
icon = 'roomstuff.dmi'
icon_state = "kirbyfire"
cost = 3000
density = 0 //cannot walk through walls'
verb/look()
set src in view(1)
usr << "Adds the fireball Magic Attack."
verb/Get()
set src in oview(0)
usr.contents+=new/obj/Attackadders/kirbyfire//This adds a mace to usr.contents *Note* always use the new var cause if you don't you will get nasty run time errors//
del(src)
verb/Drop()
set src in usr.contents
src.Move(usr.loc)
"verb/Use()
src.use += new mob/proc/fireball()
usr.contents-=new /obj/Attackadders/kirbyfire"
Can anyone tell me why it doesnt work?
I got the code in "" from somthing else but im using it deffrent than them
"verb/Use()
src.use += new mob/proc/fireball()
usr.contents-=new /obj/Attackadders/kirbyfire"
Can anyone tell me why it doesnt work?
I got the code in "" from somthing else but im using it deffrent than them

Your trying to subtract a new obj from usr.contents. This doesnt work in any way. You cannot subtract from usr.contents with -=. Try using Remove(), or del() instead:
Also if your trying to add the fireball verb, add it to usr.verbs.

Do this instead:

verb/Use()
src.verbs += /mob/proc/fireball()
del(src)

And if you want use to be the name of the statpanel that the verb is put in, do this:

mob/proc/fireball()
set category = "use"
In response to Kunark
thanks for the help, i had already firgured out the add fireball but i did need the del(src) thing. :)