Problem With Script
Solved
ScriptAPI
-
So, Im Trying To Make A Script That Insults People When You Kill Them, Heres My Code:
/// api_version=2 var target; var EntityPlayer = Java.type('net.minecraft.entity.player.EntityPlayer'); var RedeskyWords = [ "Oops, Sorry %name% My Config Is To Good", "Sorry %name% I Guess Im Just To Good", "Im not Hacking %name% I Just Have A Good Gaming Chair", "Next Time, %name% Think Twice Before Going Up Against Me", "Sorry %name%, JK", "Why All Of The Players, Including %name%, Are so bad?", "Want A I Chance Against Me? - https://www.youtube.com/watch?v=dQw4w9WgXcQ", "Your Welcome %name%", "Want To Also Hack Like This? - https://www.youtube.com/watch?v=dQw4w9WgXcQ", "Better Luck Next Time %name% (:", "I Give You My Uwu %name%", "Oops I Barely Tried On That One", "Sorry Can't Do Anything About The Kill %name%, But I Can Give You A UwU", "%name% At Least Pretend To Try Next Time" ]; var script = registerScript({ name: "Kill Insults", version: "1.0.0", authors: ["CutieHacker"] }); script.registerModule({ name: "KillInsults", category: "Misc", description: "Insults people when you kill them" }, function (module) { module.on("enable", function() { target = null; }); module.on("attack", function(event) { target = event.getTargetEntity(); if(target != null) { if (target.isDead) { mc.thePlayer.sendChatMessage(RedeskyWords[Math.Floor(Math.random() * (RedeskyWords.length+1))].replace("%name%", target.getName())); target = null; } } }); });
But The Script Seems To Not Work, I Have No Idea Why, It Shows Up In The Scripts But Upon Enabling The Moudle, It Does Nothing.
I've Been Trying To Make It Work For Hours Now If Anybody Can Help Me I Will Appreciate It!
-