A little Script I used myself before, Some codes use czechHek's TowerScaffold.js
It's the first Script that has ever been written by myself.tks
The Script used quadratic function
/// api_version=2
(script = registerScript({
name: "ZoomScaffold",
version: "1.0",
authors: ["CanYun"]
})).import("Core.lib");
var ticks = 0;
var Scaffold = moduleManager.getModule("Scaffold");
var speed = 0;
var zoom = true;
var a;
script.registerModule({
name: "ZoomScaffold",
description: "ZoomScaffold,f(tick)=a*t*t+b*t+c",
category: "Fun",
settings: {
zoomMode: Setting.boolean({
name: "ZoomMode",
default: true
}),
debug: Setting.boolean({
name: "Debug",
default: false
}),
a: Setting.float({
name: "ZoomSpeed",
min: 1,
max: 100,
default: 2.11
}),
b: Setting.float({
name: "ZoomDegree",
min: 0.1,
max: 5.0,
default: 0.16
}),
max: Setting.float({
name: "ZoomMax",
min: 1,
max: 10,
default: 1.9
}),
delay: Setting.float({
name: "ZoomDelay",
min: 0,
max: 200,
default: 40
}),
c: Setting.float({
name: "ZoomStartingPoint",
min: 0.1,
max: 5,
default: 1
})
}
}, function (module) {
module.on("enable",function(){
zoom = true;
ticks = 0;
Scaffold.setState(true);
hideScaffold = ScaffoldModule.array; hideTower = TowerModule.array;
ScaffoldModule.array = TowerModule.array = TowerModule.state = !(ScaffoldModule.state = true);
});
module.on("update", function () {
a = module.settings.a.get()*0.00000001;
if(module.settings.zoomMode.get()){
ticks++;
Scaffold.getValue("Timer").set(1.0);
if(mc.gameSettings.keyBindJump.isKeyDown()||mc.thePlayer.onGround == false){
ticks = 0;
a = 0;
speed = 1;
zoom = true;
};
if(speed >=module.settings.max.get()){
Scaffold.getValue("Timer").set(module.settings.max.get());
zoom = false;
};
if(zoom == true||ticks >> module.settings.delay.get()){
speed = a*ticks*ticks+module.settings.b.get()*ticks+module.settings.c.get();
Scaffold.getValue("Timer").set(speed);
};
}else{
Scaffold.getValue("Timer").set(1.0);
};
if(module.settings.debug.get()==true){
Chat.print(speed);
};
});
module.on("disable",function(){
Scaffold.setState(false);
ticks = 0;
zoom = false;
speed = 1;
a = 0;
ScaffoldModule.state = TowerModule.state = false;
ScaffoldModule.array = hideScaffold; TowerModule.array = hideTower;
});
module.on("jump",function(e){
!isInputHorizontally() && e.cancelEvent();
})
module.on("move",function(e){
!(ScaffoldModule.state = !(TowerModule.state = Keyboard.isKeyDown(mc.gameSettings.keyBindJump.getKeyCode()) && !isInputHorizontally())) && e.zeroXZ();//authors of this part: ["CzechHek", "yorik100"] https://github.com/CzechHek/Core/blob/master/Scripts/TowerScaffoldz.js
})
});