you should take a look at (or just use too) Chase's Wearables Library:
viewtopic.php?f=18&t=2901the key things that you're missing are:
http://quest5.net/wiki/GetDisplayNamehttp://quest5.net/wiki/GetDisplayAliasFrom Chase's Wearables Library's Coding:
To Equip (DoWear Function):
object.display = GetDisplayName(object)
object.alias = GetDisplayAlias(object) + " (worn)"
so for your code:
handgun.display = GetDisplayName (handgun)
handgun.alias = GetDisplayAlias (handgun) + " (equipped)"
Chase also accounts (codes) for not being able to drop the equipped gear (which you don't do):
object.original_drop = object.drop
// you could also do this instead by just setting: handgun.drop=false
and due to Chase's use of "GetDisplayName", this is needed with it:
To Unequip (DoRemove Function):
object.display = null
for your code, it'd be:
handgun.display = null
-----------------------------------
so, while it'd be hard to figure out exactly what and why stuff is going on for you in your code, we do know that you need to use the (To Equip Function) "GetDisplayName" and (To Unequip Function) "handgun.display=null", to hopefully wipe out your code errors, if I got this understood correctly, lol.