ID:165791
 
I've looked at quite a few libraries and demos. I don't understand half of the commands in them. Could anyone explain to me how I would go about displaying a HP/MP bar over a player's head? I wanna learn how to do it, not copy and paste from the demos and libraries. Using the Help or DM blue book doesnt not help me. I cant invison using the commands explained in the DM Blue Book, and the help file isnt very helpful when you want to use commands in a certain way >_>

2 other things that tie in with the above that I would like to know how to do is:
-display damage when player is hit
-display player's name underneath player
Would've helped if you said what commands you didn't understand.. but if you want a basic, simple, easy way to do hp bars just use overlays

mob/proc/HP()
src.overlays = new //Resets overlays, just a faster way but not if you have other stuff but thats not what I'm here for
var/obj/O = new/obj/ //creates object, again better ways but this'll do
O.icon = 'hp bar.dmi' //Sets icon
O.icon_state = "[round((M.hp/M.maxhp)*100)]" //Sets icon_state between 1-100% which you should have icon_states for
O.pixel_y = 32 //Sets it above player, adjust it according to how high the icon_states are
src.overlays += O //Adds it to the player

mob/proc/Damage(var/damage) //You probably have the attacker or more here but im just here to show you when to call it
src.hp -= damage
src.HP() //As Lummox said to me src must ALWAYS be the person hit XD but that was death proc.. but meh
//Death check and such


As for name.. I don't feel like going into that right now XD look at those demos again! >.>