Help! Original value on slide..

MasterCodeView

Solid & Active Platinian
float = 5;

float (*old_speed)(void *instance);
float speed(void *instance) {
if (instance != NULL && Speed) {
return (float) Speed;
}
return old_speed(instance);
}
HOOK_LIB("libil2cpp.so", "0x46DD9C", speed, old_speed);

OBFUSCATE("10_CollapseAdd_SeekBar_SPEED_1_50"),

case 10:
Speed = value;
break;

Does anyone know if it's possible to make the value go back to the original when the slide is between 1 and 5?
 
Code:
int *valueptr;
int slidervalue = 1;

// Rest of Code

case 0: //Your slider Case
 if(valueptr == NULL){
    valueptr = &value;
   }
   slidervalue = value;
   break;
case 1: //Your reset button case
   if(valueptr != NULL){
       *valueptr = 1;
     }
     break;

Try this
 
It will set the slider value back to original, but it might not change the visual slider value on mod menu. For that you might have to update/sync the display. I am not sure how to do that but maybe someone can help
 
1660139313490.png

You only need fix this 2 things here

int Speed = 1;

&& Speed > 1
 
Not quite how to explain it but... But there is a way when the slide is between 1 and 5 it goes back to the original value (I don't know what the original value is in libil2cpp so I can put it in the mod)
If you want the original code restored, you can disable your hook and use RESTORE_LIB() (The examples are there in the menu template). Not sure if i am still getting your question properly
 
Not quite how to explain it but... But there is a way when the slide is between 1 and 5 it goes back to the original value (I don't know what the original value is in libil2cpp so I can put it in the mod)
Im gonna put u on simple way to understand

C++:
float(*old_Speed)(void *instance);
float Speed(void *instance) {
    if (instance != NULL && speed > 1) {
        return old_Speed(instance) * (float)speed; //original value * (your value)
    }
    return old_Speed(instance);
}
 
If you want the original code restored, you can disable your hook and use RESTORE_LIB() (The examples are there in the menu template). Not sure if i am still getting your question properly
not quite that, for example when the slide is between 0~5 it will be the original value, but when it is in the other number it will increase according to the number, but thanks anyway.
 
Back
Top Bottom