ID:1761597
 
Keywords: space
(See the best response by Mightymo.)
Code:
obj/Click()
for(var/obj/hud/hand/H)
if((H.selected == 1) && (H.busy == 0) && (pick_up == 1))
if(taken == 0)
H.busy = 1
src.taken = 1
src.loc = usr
H.underlays += src
layer
usr << "You get [src]"

obj/DblClick()
sleep(2)
for(var/obj/hud/hand/H)
if((H.selected == 1) && (H.busy == 1) && (pick_up == 1))
if(taken == 1)
H.busy = 0
src.taken = 0
src.loc = usr.loc
H.overlays -= src
usr << "You drop [src]"
break


Problem description:

Hands for the pick up of objects. Overlays don't work good. I don`t speak english, sorry.
Best response
Well, first of all, you originally added to underlays, but you try to remove from overlays; these are not the same list. Second, you're looping through all hands in world, so you will not get the results you expect. For example, somebody else might own the hand that picks up an object, or a hand different than the one you click will become not busy when you try to drop.
Hand tied to Ckey player.
That is irrelevant, because you never take that into account.