scripting help for noobs xd
-
so, ive tried to make a script to change the onground timer value to a different one than the inair value but ive got the problem that the value doesnt change with this code here:
var Timer_Value = value.createInteger("Speed", 1, 1, 10);
if(mc.thePlayer.onGround) {
mc.timer.timerSpeed = Timer_Value;
} else {
if(!mc.thePlayer.onGround) {
mc.timer.timerSpeed = 1;
so im asking what is wrong or broken that it doesnt work -
@Schneelein var Timer_Value = value.createInteger("Speed", 1, 1, 10);
if(mc.thePlayer.onGround) {
mc.timer.timerSpeed = Timer_Value;
} else {
if(!mc.thePlayer.onGround) {
mc.timer.timerSpeed = 1;
}
});module.on("packet", function(eventData) { });
});
-
///api_version=2 (script = registerScript({ name: "TimerHandle", version: "1.0", authors: ["You"] })).import("Core.lib"); //just assumed your using core since you used value.createInteger, if not just put Core.lib in scripts folder list = [ //put values in here, looks clean if multiple onGroundValue = value.createFloat("OnGroundTimer", 1, 1, 10) //use float instead of integer, its more percise yet lets you adjust from 1.0 to 10.0 like you did it ] module = { name: "TimerHandle", category: "Misc", description: "Helps you to learn", tag: script.scriptVersion, values: list, //import list here so the module knows what to use //now the actual module onUpdate: function() { if (mc.thePlayer.onGround) { mc.timer.timerSpeed = onGroundValue.get() } else if (!mc.thePlayer.onGround /*you could add a check for water etc if you want to be faster there as well*/) { mc.timer.timerSpeed = 1; } }, onDisable: function() { mc.timer.timerSpeed = 1; //If you disable the module while being onGround you may stay faster than vanilla, so reset onDisable! } }
The issue with yours is probably the core module structure without importing core but from what you've posted i can't really tell.
Ah yes i figured out what your problem was:
you didmc.timer.timerSpeed = Timer_Value
but it must be
mc.timer.timerSpeed = module.settings.Timer_Value.get() //or if you are using core mc.timer.timerSpeed = Timer_Value.get()