ID:1633126
 
(See the best response by LordAndrew.)
Code:None

mob
DblClick()
if(get_dist(src, usr) <= 2)
oview(12) << output("[src] attacks [usr]!","output1")
usr.Health-=5
Death()


Problem description:I have been trying to create an attack system with DblClick(), but I can't figure out how to use it correctly! I know how DblClick works, but I can't figure out how to use it in an attacking system.

Best response
You mostly have it, though it's a bit backwards. With Click() and DblClick(), usr is the one clicking, while src is the one being clicked.

mob/DblClick()
world << "[usr] is the usr, [src] is the src. So [usr] clicked on [src]!"
In response to LordAndrew
Thank you!