A Health Display

Avatar

By SuperSkidder_ 12 September 2019 10:51

Member · 5 comments

A Health DisPlay
I don't think I can confirm whether he can work properly.
If there are any mistakes, please point them out for me.

var scriptName = "Health";
var scriptVersion = 1.0;
var scriptAuthor = "SuperSkidder";
var Module = new Module();
var client;

script.import("lib/glFunctions.js");
script.import("lib/systemFunctions.js")

function Module() {
  
   var interval;
    this.getName = function() {
        return "Health";
    };

    this.getDescription = function() {
        return "Render";
    };

    this.getCategory = function() {
        return "Render";
    };
	
	this.onRender2D = function (){
		var mcHeight = getScaledHeight();
        var mcWidth = getScaledWidth();
		var Playerhealth = mc.theplayer.getHealth(); 
		        if(PlayerHealth<10){
        mc.fontRendererObj.drawStringWithShadow(PlayerHealth , mcWidth - mcWidth / 2 - 5, mcHeight - mcHeight / 2 - 14, 0xff0000);
}else{
        mc.fontRendererObj.drawStringWithShadow(PlayerHealth , mcWidth - mcWidth / 2 - 5, mcHeight - mcHeight / 2 - 14, 0x00CD00);
}
		
	}
    
}
function onLoad() {}

function onEnable() {
    client = moduleManager.registerModule(Module);
}

function onDisable() {
    moduleManager.unregisterModule(client);
}

Im a bad guy

Avatar

By xiaozhao_js 13 September 2019 07:04

Member · 13 comments

great

Avatar

By ButterChiCken 18 September 2019 03:50

Member · 14 comments

Wow nice!


I am doing my own thing.

Avatar

By SuperheroMC 19 September 2019 00:14

Member · 5 comments

nice smile