Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. ScriptAPI
  3. Problem With Script

Problem With Script

Scheduled Pinned Locked Moved Solved ScriptAPI
32 Posts 4 Posters 24.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • kumri owoK kumri owo

    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!

    A
    A
    Alina00035
    wrote on last edited by
    #2

    @cutiehacker Try to look in the console log for the errors.

    kumri owoK 1 Reply Last reply
    1
    • A Alina00035

      @cutiehacker Try to look in the console log for the errors.

      kumri owoK
      kumri owoK
      kumri owo
      wrote on last edited by
      #3

      @ali00035 Im new too scripting, where is the console located?

      A 1 Reply Last reply
      19
      • kumri owoK kumri owo

        @ali00035 Im new too scripting, where is the console located?

        A
        A
        Alina00035
        wrote on last edited by Alina00035
        #4

        @cutiehacker Console log is in the launcher console. Scroll up in the launcher console.

        kumri owoK 1 Reply Last reply
        0
        • A Alina00035

          @cutiehacker Console log is in the launcher console. Scroll up in the launcher console.

          kumri owoK
          kumri owoK
          kumri owo
          wrote on last edited by
          #5

          @ali00035 And Where Is The Console (Im Sorry, I Just Have Really No Idea How To Do Stuff Like That)

          A 1 Reply Last reply
          19
          • kumri owoK kumri owo

            @ali00035 And Where Is The Console (Im Sorry, I Just Have Really No Idea How To Do Stuff Like That)

            A
            A
            Alina00035
            wrote on last edited by Alina00035
            #6

            @cutiehacker said in Problem With Script:

            @ali00035 And Where Is The Console (Im Sorry, I Just Have Really No Idea How To Do Stuff Like That)

            Enable the launcher output in the launcher settings.

            kumri owoK 1 Reply Last reply
            0
            • A Alina00035

              @cutiehacker said in Problem With Script:

              @ali00035 And Where Is The Console (Im Sorry, I Just Have Really No Idea How To Do Stuff Like That)

              Enable the launcher output in the launcher settings.

              kumri owoK
              kumri owoK
              kumri owo
              wrote on last edited by
              #7

              @ali00035 It said It successfully loaded the script, but I already knew that

              A 1 Reply Last reply
              20
              • kumri owoK kumri owo

                @ali00035 It said It successfully loaded the script, but I already knew that

                A
                A
                Alina00035
                wrote on last edited by
                #8

                @cutiehacker Oh, I misread, sorry.

                kumri owoK 1 Reply Last reply
                0
                • kumri owoK kumri owo

                  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!

                  A
                  A
                  Alina00035
                  wrote on last edited by
                  #9

                  @cutiehacker said in Problem With Script:

                  Math.Floor

                  Math.floor is the right way.

                  kumri owoK 1 Reply Last reply
                  0
                  • A Alina00035

                    @cutiehacker Oh, I misread, sorry.

                    kumri owoK
                    kumri owoK
                    kumri owo
                    wrote on last edited by
                    #10

                    @ali00035 its ok, Its a problem with the code

                    1 Reply Last reply
                    20
                    • A Alina00035

                      @cutiehacker said in Problem With Script:

                      Math.Floor

                      Math.floor is the right way.

                      kumri owoK
                      kumri owoK
                      kumri owo
                      wrote on last edited by
                      #11

                      @ali00035 What about math.floor? I am using that already in the script

                      A 1 Reply Last reply
                      17
                      • kumri owoK kumri owo

                        @ali00035 What about math.floor? I am using that already in the script

                        A
                        A
                        Alina00035
                        wrote on last edited by
                        #12

                        @cutiehacker said in Problem With Script:

                        @ali00035 What about math.floor? I am using that already in the script

                        The correct way is just Math.floor

                        kumri owoK 1 Reply Last reply
                        0
                        • A Alina00035

                          @cutiehacker said in Problem With Script:

                          @ali00035 What about math.floor? I am using that already in the script

                          The correct way is just Math.floor

                          kumri owoK
                          kumri owoK
                          kumri owo
                          wrote on last edited by
                          #13

                          @ali00035 can you show me the code, because I cant quite understand what you mean by "The Correct Way Is Just Math.Floor"

                          A 1 Reply Last reply
                          19
                          • kumri owoK kumri owo

                            @ali00035 can you show me the code, because I cant quite understand what you mean by "The Correct Way Is Just Math.Floor"

                            A
                            A
                            Alina00035
                            wrote on last edited by
                            #14

                            @cutiehacker Instead of "Math.Floor" or "math.floor", You just have to type "Math.floor"

                            kumri owoK 1 Reply Last reply
                            0
                            • A Alina00035

                              @cutiehacker Instead of "Math.Floor" or "math.floor", You just have to type "Math.floor"

                              kumri owoK
                              kumri owoK
                              kumri owo
                              wrote on last edited by
                              #15

                              @ali00035 no..........

                              A 1 Reply Last reply
                              20
                              • kumri owoK kumri owo

                                @ali00035 no..........

                                A
                                A
                                Alina00035
                                wrote on last edited by
                                #16

                                @cutiehacker ?

                                kumri owoK 1 Reply Last reply
                                0
                                • A Alina00035

                                  @cutiehacker ?

                                  kumri owoK
                                  kumri owoK
                                  kumri owo
                                  wrote on last edited by
                                  #17

                                  @ali00035 It works Thank You, I cant believe such a simple mistake cost me that much time!

                                  A 1 Reply Last reply
                                  19
                                  • kumri owoK kumri owo has marked this topic as solved on
                                  • kumri owoK kumri owo

                                    @ali00035 It works Thank You, I cant believe such a simple mistake cost me that much time!

                                    A
                                    A
                                    Alina00035
                                    wrote on last edited by
                                    #18

                                    @cutiehacker No problem.

                                    Nice avatar by the way.

                                    kumri owoK 1 Reply Last reply
                                    0
                                    • A Alina00035

                                      @cutiehacker No problem.

                                      Nice avatar by the way.

                                      kumri owoK
                                      kumri owoK
                                      kumri owo
                                      wrote on last edited by
                                      #19

                                      @ali00035 thanks!

                                      A 1 Reply Last reply
                                      18
                                      • kumri owoK kumri owo

                                        @ali00035 thanks!

                                        A
                                        A
                                        Alina00035
                                        wrote on last edited by
                                        #20

                                        @cutiehacker No problem again. 😄

                                        kumri owoK 1 Reply Last reply
                                        1
                                        • A Alina00035

                                          @cutiehacker No problem again. 😄

                                          kumri owoK
                                          kumri owoK
                                          kumri owo
                                          wrote on last edited by
                                          #21

                                          @ali00035 One More Question The Server This Is For (minemora) Has a zombie that for some reason the kill player is the zombie, Is there a way to check if the entity is not a zombie?

                                          kumri owoK 1 Reply Last reply
                                          19

                                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                          With your input, this post could be even better 💗

                                          Register Login
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          About
                                          • Terms of Service
                                          • Privacy Policy
                                          • Status
                                          • Contact Us
                                          Downloads
                                          • Releases
                                          • Source code
                                          • License
                                          Docs
                                          • Tutorials
                                          • CustomHUD
                                          • AutoSettings
                                          • ScriptAPI
                                          Community
                                          • Forum
                                          • Guilded
                                          • YouTube
                                          • Twitter
                                          • D.Tube
                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Groups