[REQUEST] vanilla damage fly script
-
how to damage the complicated way
var packet = e.getPacket(); if(packet instanceof C03PacketPlayer) { if(e.getState() == "OUTGOING"){ if(damageProgress < 4){ if(damageProgress == 0){ packet.onGround = true; }else if(damageProgress == 1){ mc.thePlayer.onGround && (mc.thePlayer.jump()); packet.y = mc.thePlayer.posY + Math.random() * (4 - 3.04) + 3.04; packet.onGround = false; }else if(damageProgress == 2){ packet.onGround = false; }else if(damageProgress == 3){ mc.thePlayer.setPosition(mc.thePlayer.posX, Math.round(mc.thePlayer.posY) + 0.42, mc.thePlayer.posZ); } damageProgress++; } } }
-
@skiddermaster412
where do i put this in the script -
@skiddermaster412
Im not good with code so this is what my 2% brain power has done **done being cntrl c + cntrl v **
///api_version=2
(script = registerScript({
name: "VerusDmgFly",
authors: ["Skiddermaster"],
version: "1.0"var packet = e.getPacket();
if(packet instanceof C03PacketPlayer) {
if(e.getState() == "OUTGOING"){
if(damageProgress < 4){
if(damageProgress == 0){
packet.onGround = true;
}else if(damageProgress == 1){
mc.thePlayer.onGround && (mc.thePlayer.jump());
packet.y = mc.thePlayer.posY + Math.random() * (4 - 3.04) + 3.04;
packet.onGround = false;
}else if(damageProgress == 2){
packet.onGround = false;
}else if(damageProgress == 3){
mc.thePlayer.setPosition(mc.thePlayer.posX, Math.round(mc.thePlayer.posY) + 0.42, mc.thePlayer.posZ);
}
damageProgress++;
}
}
} -
@somehax ```
/// api_version=2
var safewalkModule = moduleManager.getModule("Safewalk");
var timerModule = moduleManager.getModule("Timer");
var script = registerScript({
name: "FlyNew",
version: "1.0.0",
authors: ["GLOBALBOSS&JustNanix&Caxap"]
});script.registerModule({
name: "FlyNew",
category: "Fun",
description: "Moded GLOBALBOSS",
settings: {
damagePos: Setting.float({
name: "DamagePosition",
min: 0,
max: 400,
default: 200
}),
flySpeed: Setting.float({
name: "FlySpeed",
min: 0.20,
max: 0.30,
default: 0.22
}),
glide: Setting.float({
name: "Glide",
min: 0.00,
max: 0.05,
default: 0.010
})
}
}, function(module) {
var delay = 0;
var enable = true;
var flyspeed = module.settings.flySpeed.get();
module.on("update", function() {
if (mc.thePlayer.onGround) {
safewalkModule.setState(true)
}
if (!mc.thePlayer.onGround) {
if (enable) {
timerModule.setState(true)
mc.thePlayer.setPosition(mc.thePlayer.posX, module.settings.damagePos.get() - module.settings.damagePos.get() * 2, mc.thePlayer.posZ);
enable = false;
}
if (mc.thePlayer.getHealth() <= 19) {
mc.thePlayer.onGround = false;
mc.thePlayer.capabilities.setFlySpeed(module.settings.flySpeed.get() / 2);
mc.thePlayer.motionY = module.settings.glide.get() - module.settings.glide.get() * 2;
mc.thePlayer.capabilities.isFlying = true;
} else {
mc.thePlayer.setPosition(mc.thePlayer.posX, module.settings.damagePos.get() - module.settings.damagePos.get() * 2, mc.thePlayer.posZ);
}
}
});
module.on("enable", function() {
enable = true;
});
module.on("disable", function() {
mc.thePlayer.capabilities.isFlying = false;
safewalkModule.setState(false)
timerModule.setState(false)
});
});function onLoad() {}