[HLEP]HOW? Detect target injury in scripts!
-
script.registerModule({
name: "AutoL-tell",
description: "AutoL in /tell",
category: "Fun",
tag:"NULL",
settings: {
Mode: Setting.list({
name: "Mode",
default: "Chinese",
values: ["Lag","Chinese","English","Advertise"]
}),
}
}, function (module) {
module.on("enable", function () {
target = null;
})
module.on("attack", function (event) {
if(event.getTargetEntity() instanceof EntityPlayer){
target = event.getTargetEntity();
}
})
module.on("update", function () {
module.tag=module.settings.Mode.get();
if (target != null) {
if (target.hurtTime > 0) {
switch(module.settings.Mode.get()){
case "Lag":{
mc.thePlayer.sendChatMessage("I'm hacker,pls report me "+target.getName());
break;
}
case "Chinese":{
mc.thePlayer.sendChatMessage("/tell "+target.getName()+" "+ChineseWords[parseInt(Math.random()*ChineseWords.length)]);
break;
}
case "English":{
mc.thePlayer.sendChatMessage("/tell "+target.getName()+" "+EnglishWords[parseInt(Math.random()*EnglishWords.length)]);
break;
}
case "Advertise":{
mc.thePlayer.sendChatMessage("/tell "+target.getName()+" "+AdvertiseWords[parseInt(Math.random()*AdvertiseWords.length)].replace(/%name%/,target.getName()));
break;
}
}
target = null;
}
}
})
})look pls!!!
-
that's okay
-
@0x64 thx!
-
-
@cookiechinese 你能不能给一个简单一点的?
我不想在HY用! -
@0x64 target.getHealth()==0
can use this?