CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Solved Problem With Script

    ScriptAPI
    4
    32
    462
    Loading More Posts
    • 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 owo
      kumri owo last edited by 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!

      Ali00035 2 Replies Last reply Reply Quote 19
      • Ali00035
        Ali00035 Banned @kumri owo last edited by

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

        kumri owo 1 Reply Last reply Reply Quote 0
        • Ali00035
          Ali00035 Banned @kumri owo last edited by

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

          kumri owo 1 Reply Last reply Reply Quote 1
          • kumri owo
            kumri owo @Ali00035 last edited by

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

            Ali00035 1 Reply Last reply Reply Quote 19
            • Ali00035
              Ali00035 Banned @kumri owo last edited by Ali00035

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

              kumri owo 1 Reply Last reply Reply Quote 0
              • kumri owo
                kumri owo @Ali00035 last edited by

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

                Ali00035 1 Reply Last reply Reply Quote 19
                • Ali00035
                  Ali00035 Banned @kumri owo last edited by Ali00035

                  @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 owo 1 Reply Last reply Reply Quote 0
                  • kumri owo
                    kumri owo @Ali00035 last edited by

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

                    Ali00035 1 Reply Last reply Reply Quote 20
                    • Ali00035
                      Ali00035 Banned @kumri owo last edited by

                      @cutiehacker Oh, I misread, sorry.

                      kumri owo 1 Reply Last reply Reply Quote 0
                      • Ali00035
                        Ali00035 Banned @kumri owo last edited by

                        @cutiehacker said in Problem With Script:

                        Math.Floor

                        Math.floor is the right way.

                        kumri owo 1 Reply Last reply Reply Quote 0
                        • kumri owo
                          kumri owo @Ali00035 last edited by

                          @ali00035 its ok, Its a problem with the code

                          1 Reply Last reply Reply Quote 20
                          • kumri owo
                            kumri owo @Ali00035 last edited by

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

                            Ali00035 1 Reply Last reply Reply Quote 17
                            • Ali00035
                              Ali00035 Banned @kumri owo last edited by

                              @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 owo 1 Reply Last reply Reply Quote 0
                              • kumri owo
                                kumri owo @Ali00035 last edited by

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

                                Ali00035 1 Reply Last reply Reply Quote 19
                                • Ali00035
                                  Ali00035 Banned @kumri owo last edited by

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

                                  kumri owo 1 Reply Last reply Reply Quote 0
                                  • kumri owo
                                    kumri owo @Ali00035 last edited by

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

                                    Ali00035 1 Reply Last reply Reply Quote 20
                                    • Ali00035
                                      Ali00035 Banned @kumri owo last edited by

                                      @cutiehacker ?

                                      kumri owo 1 Reply Last reply Reply Quote 0
                                      • kumri owo
                                        kumri owo @Ali00035 last edited by

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

                                        Ali00035 1 Reply Last reply Reply Quote 19
                                        • Topic has been marked as solved  kumri owo kumri owo 
                                        • Ali00035
                                          Ali00035 Banned @kumri owo last edited by

                                          @cutiehacker No problem.

                                          Nice avatar by the way.

                                          kumri owo 1 Reply Last reply Reply Quote 0
                                          • kumri owo
                                            kumri owo @Ali00035 last edited by

                                            @ali00035 thanks!

                                            Ali00035 1 Reply Last reply Reply Quote 18
                                            • Ali00035
                                              Ali00035 Banned @kumri owo last edited by

                                              @cutiehacker No problem again. 😄

                                              kumri owo 1 Reply Last reply Reply Quote 1
                                              • First post
                                                Last post
                                              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