ID:147998
 
obj
rockfall
icon = 'skills.dmi'
icon_state="rockfall"
rockfallb
name = "Rock Fall"
icon='skills.dmi'
icon_state="rockbutton"
DblClick(mob/M )
var.damage
if(usr.mp <= 0)
usr << "You don't have enough magic"
else
usr.overlays += 'skills.dmi'
usr.mp-= 5
sleep(50)
usr.overlays -= 'skills.dmi'
missile(/obj/rockfall, usr, M)
damage = 4
damage += usr.mpstr
damage -= M.mpdef
M.hp -= damage
M.overlays += /obj/rockfall
sleep(5)
M.overlays -= /obj/rockfall
and when i test it, and doublelcick it in inventory, it gives me this error
Rock Fall (/obj/rockfallb): DblClick("Skills")
runtime error: Cannot read "Skills".loc
proc name: DblClick (/obj/rockfallb/DblClick)
usr: Kablez (/mob)
src: Rock Fall (/obj/rockfallb)
call stack:
Rock Fall (/obj/rockfallb): DblClick("Skills")

DblClick's argument is not a mob; that's why you're getting this error. It's being passed the name of the statpanel where you clicked it.

The correct thing to use instead of M is just usr.

Lummox JR
In response to Lummox JR
so i should use Click(mob/M)??
In response to Kablez
No... what he is saying is that the argument for DblClick() is not a mob so DblClick(mob/M) is not valid. So take out the mob/M and for everything that accesses a var using M: change to usr.

Resonating Light
In response to Resonating_Light
wouldnt that attack the one who double clicked it then?
In response to Kablez
No.
In response to Resonating_Light
well i fixed it, now i want to know how toa dd objs to a list by using a proc, im using the proc lvl() to check if the usr is lvl 5 and add /obj/healb to list, how would i do thaT?