[HELP] Converting Core scripts to Script API v2 scripts.
-
you nearly in the right path,
see how the other scripts work.
you are far away from converting the script
here take it, just to educate you and not to steal it.///api_version=2 var script = registerScript({ name: "AutoSafeWalk", version: "1.3", authors: ["CzechHek"] }); var airsafe = Setting.boolean({ name: "AirSafe", default: true }); var maxfalldistance = Setting.integer({ name:"MaxFallDistance", default: 5, min: 0, max: 255 }); script.registerModule({ name: "AutoSafeWalk" category: "Movement", description: "SafeWalk that activates if there is a gap exceeding maximal fall distance.", settings: { airsafe: airsafe, maxfalldistance: maxfalldistance } }, function (module){ module.on("move", function(e){ (mc.thePlayer.onGround || airsafe.get()) && e.setSafeWalk(!isAboveGround()); }); }); function isAboveGround() { var BlockPos = Java.type("net.minecraft.util.BlockPos"); for (i = 0, bp = new BlockPos(mc.thePlayer); i++ < maxfalldistance.get();) if (!mc.theWorld.isAirBlock(bp.down(i))) return true }
compare and see what errors you had.
(btw i made this without testing so if it works it works) -
i used to port CzechHek's scripts all of the time, i don't really like core
-
@skiddermaster412 After testing this, it did not work. I'm trying to fix it by reading more scripts. Thank you for your help though.
-
@skiddermaster412 do you even remember how to add a setting
edit: nvm im retarded, the reason why it doesnt work its bcz you didnt import BlockPos
edit 2:nvm im too retarded -
i just realized something
cant find setSafeWalk in the docs idfk
-
@sigma-bot apparently its from api v1
https://github.com/CCBlueX/LiquidScript/blob/master/ScriptAPI-v1 Docs/module/event.md
-
@golikeazzis they work on it, however as far as I remember Lint had nothing special to offer, spammed errors of missing images in logs and its scriptapi somehow didn't fully work
garbage
-
This post is deleted!