forked from SelfMadeSystem/Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BHop test.js
84 lines (72 loc) · 2.62 KB
/
BHop test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
var scriptName = "Bhop test";
var scriptVersion = 1.0;
var scriptAuthor = "Sms_Gamer";
var BhopTest = new BhopTest();
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 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 vClip(offset) {
mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + offset, mc.thePlayer.posZ);
}
function hClip(offset) {
var playerYaw = Math.radians(mc.thePlayer.rotationYaw);
mc.thePlayer.setPosition(mc.thePlayer.posX - (Math.sin(playerYaw) * offset), mc.thePlayer.posY, mc.thePlayer.posZ + (Math.cos(playerYaw) * offset));
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var client;
function BhopTest() {
var ticks = 0;
this.getName = function() {
return "BhopTest";
};
this.getDescription = function() {
return "Bhop test";
};
this.getCategory = function() {
return "Movement";
};
this.onEnable = function() {
}
this.onUpdate = function() {
ticks++
if (mc.gameSettings.keyBindForward.isKeyDown() && !mc.thePlayer.isSneaking()) {
mc.thePlayer.setSprinting(true);
if(mc.thePlayer.onGround) {
mc.thePlayer.jump();
mc.timer.timerSpeed = 2 //changeable
mc.thePlayer.speedInAir = 0.0125; //changeable
if(ticks == 2 || ticks == 4 || ticks == 6 || ticks ==8 || ticks == 12 || ticks == 16 || ticks == 18 || ticks == 20) {
//just examples
//hClip(1)
}else {
//speedinair
//mc.thePlayer.motionX = 0;
//mc.thePlayer.motionZ = 0;
}
}
} else {
mc.thePlayer.speedInAir = 0.02;
mc.timer.timerSpeed = 1
}
if(ticks == 20) {
ticks = 0;
}
}
this.onDisable = function () {
mc.thePlayer.speedInAir = 0.02;
mc.timer.timerSpeed = 1
}
}
function onLoad() {}
function onEnable() {
client = moduleManager.registerModule(BhopTest);
}
function onDisable() {
moduleManager.unregisterModule(client);
}