How Do I Make "Wait" Time On Coding?

Avatar

By Beppe1509 17 March 2019 10:16

Member · 2 comments

Hello Guys Please Help Me I Want To Make Something Like That

1. jump
2. wait 8.7 secs
3. fly

I Know How To Do 1 and 3 But Not 2...
Please Help

Avatar

By Survi_G 17 March 2019 12:51

Member · 168 comments

if(mc.thePlayer.ticksExisted % 32 == 0) {
    mc.thePlayer.motionY = 1;
  }

Avatar

By Shiv3R 17 March 2019 12:53

Member · 144 comments

1tick = 1/20 of second
then
20*8=160 = 8s
0.7s=14ticks
160+14ticks = 8.7s
174ticks = 8.7s
then u can check delay by ticksExisted:

onEnable:
var x=1;

onUpdate:
if (x==1 && mc.thePlayer.ticksExisted % 174 == 0){ // change 174 to ticks that you want to delay
//stuff
}

onDisable:
var x = 0;

Avatar

By yorik100 17 March 2019 13:14

Member · 152 comments
var ticks = 0
var hasjumped = false
this.onUpdate = function () {
if (mc.gameSettings.keyBindJump.isKeyDown() && mc.thePlayer.onGround && hasjumped == false){
hasjumped = true;
}
if (hasjumped == true){
ticks++;
}
if (ticks >= 174){
var flyModule = moduleManager.getModule("Fly");
flyModule.setState(true);
ticks = 0;
hasjumped = false;
}
}

It may look like that but I didn't try anything

Last edited by yorik100 (17 March 2019 13:14)

Avatar

By soulplexis 21 March 2019 18:25

Donator · 216 comments

add a variable like ticks = 0;
then you do ticks++; on the onUpdate
then add code for
if(ticks == #ofticksin8.7seconds) {
ticks = 0;
}
then in your jump code you do
if(ticks == 0) {
mc.thePlayer.jump;
}


【ソルプレクサス】