CCBlueX Forum

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

    scripting help for noobs xd

    Scripts
    3
    3
    108
    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.
    • S
      Schneelein last edited by

      so, ive tried to make a script to change the onground timer value to a different one than the inair value but ive got the problem that the value doesnt change with this code here:
      var Timer_Value = value.createInteger("Speed", 1, 1, 10);
      if(mc.thePlayer.onGround) {
      mc.timer.timerSpeed = Timer_Value;
      } else {
      if(!mc.thePlayer.onGround) {
      mc.timer.timerSpeed = 1;
      so im asking what is wrong or broken that it doesnt work

      sxviolence FaaatPotato 2 Replies Last reply Reply Quote 0
      • sxviolence
        sxviolence @Schneelein last edited by

        @Schneelein var Timer_Value = value.createInteger("Speed", 1, 1, 10);
        if(mc.thePlayer.onGround) {
        mc.timer.timerSpeed = Timer_Value;
        } else {
        if(!mc.thePlayer.onGround) {
        mc.timer.timerSpeed = 1;
        }
        });

        module.on("packet", function(eventData) {
        
        });
        

        });

        1 Reply Last reply Reply Quote 0
        • FaaatPotato
          FaaatPotato @Schneelein last edited by FaaatPotato

          @Schneelein

          ///api_version=2
          (script = registerScript({
              name: "TimerHandle",
              version: "1.0",
              authors: ["You"]
          })).import("Core.lib"); //just assumed your using core since you used value.createInteger, if not just put Core.lib in scripts folder
          
          list = [ //put values in here, looks clean if multiple
              onGroundValue = value.createFloat("OnGroundTimer", 1, 1, 10) //use float instead of integer, its more percise yet lets you adjust from 1.0 to 10.0 like you did it
          ]
          
          module = {
              name: "TimerHandle",
              category: "Misc",
              description: "Helps you to learn",
              tag: script.scriptVersion,
              values: list, //import list here so the module knows what to use
          
              //now the actual module
              onUpdate: function() {
                  if (mc.thePlayer.onGround) {
                      mc.timer.timerSpeed = onGroundValue.get()
                  } else if (!mc.thePlayer.onGround /*you could add a check for water etc if you want to be faster there as well*/) {
                      mc.timer.timerSpeed = 1;
                  }
              },
              onDisable: function() {
                  mc.timer.timerSpeed = 1; //If you disable the module while being onGround you may stay faster than vanilla, so reset onDisable!
              }
          }
          

          The issue with yours is probably the core module structure without importing core but from what you've posted i can't really tell.

          Ah yes i figured out what your problem was:
          you did

          mc.timer.timerSpeed = Timer_Value
          

          but it must be

          mc.timer.timerSpeed = module.settings.Timer_Value.get()
          //or if you are using core
          mc.timer.timerSpeed = Timer_Value.get()
          

          i suggest you read this and try simple stuff

          1 Reply Last reply Reply Quote 0
          • 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