obj/bar/healthOverlay
icon='Healthbar.dmi';icon_state="overlay"
pixel_y=38;layer=100;pixel_x=-1
obj/bar/health
icon='healthBar.dmi';icon_state="health"
pixel_y=38;layer=99;pixel_x=-1
mob/proc/healthCheck()
var/obj/bar/healthOverlay/o=new()
var/obj/bar/health/h=new()
var matrix/m=new()
src.overlays-=src.healthBar
src.overlays-=h;src.overlays-=o
src.overlays+=o
m.Scale(src.hp/src.maxhp,1)
h.transform=m
h.pixel_x+=(((src.hp/src.maxhp)-1)*10) * (((h.bound_width/2)-1)/9.5)
src.healthBar=h
src.overlays+=h
Barcode.dm:16:error: src.healthBar: undefined var
Barcode.dm:19:error: src.hp: undefined var
Barcode.dm:19:error: src.maxhp: undefined var
Barcode.dm:21:error: src.hp: undefined var
Barcode.dm:21:error: src.maxhp: undefined var
Barcode.dm:22:error: src.healthBar: undefined var
Problem description:
I was watching a tutorial https://www.youtube.com/watch?v=cm_yYWNLaOM&t=129s and i appear to have done something wrong and have tried many things to fix it but it just wont work, I wish to know if there is anything wrong here or if i should just try to find another way of making a healthbar.
for example
mob/var
hp=0
healthBar
maxhp=10