ID:262640
 
Code:
mob
Bump(obj/O)
if(isobj(O))
if(ispath(/obj/Weapons/))//if it is a object located within Weapons if(length(src.contents))
for(var/obj/O2 in src.contents)//for every object inthe inventory, delete them
del(O2)
src.contents += O
src.weapon = O
src << "New weapon!"
if(ispath(/obj/Items/))
src.items += O


Problem description: What I'm tyring to do is make the bump work different depending on what type of object it is. In the code above, only the first part of the bump works, ignoring the 2nd part.

ispath() is only verifying that /obj/Weapons is a valid type path, which it is. What you need is istype(), and you need to tell it that O is the object you're checking.

Lummox JR
In response to Lummox JR
Ok thanks.