This Login code gets 2 errors on it. Soemone help me with it.
Login(mob/M)
src.healthbar=new/obj/health_meter1//make a new health bar
src.health_meter1.update(M,M.health,M.max_health)//update it
..()
test.dm:52:error:src.health_meter1.update:undefined type: src.health_meter1.update
test.dm:25:error:src.health_meter1:undefined var
Copyright © 2025 BYOND Software.
All rights reserved.
Also, Login() doesn't pass in a value. Get rid of that M var completely, it's useless. Use src instead.
As to the compilation errors, you're trying to refer to the var using the type path of the object it contains, instead of the var's name. Use healthbar, not health_meter1.
<code>Login() src.healthbar=new/obj/health_meter1 //make a new health bar src.healthbar.update(src, src.health, src.max_health) //update it ..()</code>
NOTE: Don't copy and paste this, because I've used spaces rather than tabs to indent. Instead, make the changes manually.