weapon
parent_type = /obj/grab
verb
equip()
set src in view(-1)
set name = "Equip"
for(src in usr.overlay) return // overlay is a list ah usr's overlays
src.layer = MOB_LAYER + 0.5
usr.overlay += src
usr.overlays += src
usr << "[src] equipped."
Problem description:
In runtime, it returns a error saying: "Cannot read null.layer".
I should have waited more before asking you guys, but now I know you are so smart and so helpful...
I can't get used to this.
What are you trying to do with that line? Prevent the user from equipping an item twice? You should just be able to use an if():
But I've got to mention, naming a variable "overlay" is very confusing. Why not "equipment" or something?