ID:143268
 
Code:
Diagnose
New(client/C)
C.screen += src
..()
icon = 'Hub.dmi'
icon_state = "DI2"
density = 1
layer=MOB_LAYER+3
screen_loc = "4,6"
Click()
new /obj/Hub/Buttons/PS/Diagnose_Button2/PO1/Diagnose(usr.client)
new /obj/Hub/Buttons/PS/Diagnose_Button2/PO2/Diagnose(usr.client)
new /obj/Hub/Buttons/PS/Diagnose_Button2/PO3/Diagnose(usr.client)
new /obj/Hub/Buttons/PS/Diagnose_Button2/PO4/Diagnose(usr.client)
sleep(20)
var/obj/Console/Console_1/A
if(A.whp > 100)
alert("Damage Detected")
else
alert("System to full funcatbility")


Problem description
I am trying to create a HUD button which checks damage on a console, however if i try it i get this error ingame:
proc name:

Click (/obj/Hub/Buttons/PS/Diagnose_Button/PO2/Diagnose/Click)
usr: Naztexz (/mob)
src: Diagnose (/obj/Hub/Buttons/PS/Diagnose_Button/PO2/Diagnose)
call stack:
Diagnose (/obj/Hub/Buttons/PS/Diagnose_Button/PO2/Diagnose): Click(null)

I know it is the Var, but i have no idea what to do, if you can help it will be great.
:


Put "#define DEBUG" in your game code to make the error reports more informative.
In response to Kaiochao2536
when i put that in, it deleted it when i compiled it.