var scriptName = "Spartan NoWeb";
var scriptAuthor = "cancername";
var scriptVersion = 1.0;


 // Converts from degrees to radians.
 Math.radians = function(degrees) {
    return degrees * Math.PI / 180;
  };
   
  // Converts from radians to degrees.
  Math.degrees = function(radians) {
    return radians * 180 / Math.PI;
  };

function hMotion(offset) {
        mc.thePlayer.motionX = parseFloat(Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)) * offset)
        mc.thePlayer.motionZ = parseFloat(Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)) * offset)
}
function NoWeb() {
  this.getName = function () {
    return "SprtNoWeb";
  }

  this.getDescription = function () {
    return "by cancername";
  }

  this.getCategory = function () {
    return "Fun";
  }

  this.onUpdate = function () {

		 if (mc.thePlayer.onGround && mc.thePlayer.isInWeb && mc.thePlayer.ticksExisted % 9 == 0) {
		hMotion(1)
		mc.thePlayer.jump();
		 }
		 
		 if (!mc.thePlayer.onGround && mc.thePlayer.isInWeb ) {
			 mc.thePlayer.motionY = -0.001
		hMotion(0.37)
		 }
		 
		 if (!mc.thePlayer.onGround && mc.thePlayer.isInWeb && mc.thePlayer.ticksExisted % 10 == 0) {
        hMotion(1.0)
		mc.thePlayer.motionY = 0.42
		 }
		 //idk whats wrong
		 //flags hard 
		 /* if (!mc.thePlayer.onGround && mc.thePlayer.isInWeb && mc.gameSettings.keyBindJump.isKeyDown()) {
        
		mc.thePlayer.motionY += 0.5
		 } */
		
  }
  
  
  

  this.onDisable = function () {}
}

var noWeb = moduleManager.registerModule(new NoWeb);

function onLoad() {}

function onEnable() {
  noWeb;

}
  function onDisable() {
  moduleManager.unregisterModule(noWeb);
}