Help! Mod menu attack speed multiplier does not increase

kissu7979

Platinian
this is the code i modified

float BaseAttackSpeed = 1;


float (*old_BaseAttackSpeed)(void *instance);
float AttackSpeed(void *instance) {
if (instance != NULL && BaseAttackSpeed > 1) {
return (float) BaseAttackSpeed;
}
return old_BaseAttackSpeed(instance);
}


HOOK_LIB("libil2cpp.so", "0x13707D4", AttackSpeed, old_BaseAttackSpeed);


OBFUSCATE("15_SeekBar_AttackSpeed_0_10"),

switch (value) {
case 15:

BaseAttackSpeed = value;
break;


I'm a beginner and I don't know what the problem is

What I want to know is how to go from 0x to 10x.
 
C++:
float BaseAttackSpeed = 0f;

float (*old_BaseAttackSpeed)(void *instance);
float AttackSpeed(void *instance) {
    if (instance == nullptr) return;
   
    //float original_BaseAttackSpeed = old_BaseAttackSpeed(instance); // original value
   
    return BaseAttackSpeed; // Modded
}

//HOOK_LIB("libil2cpp.so", "0x13707D4", AttackSpeed, old_BaseAttackSpeed);
// Idk why you use HOOK_LIB when you can use HOOk

HOOK("0x13707D4", AttackSpeed, old_BaseAttackSpeed);


OBFUSCATE("15_SeekBar_AttackSpeed_0_10"),


switch (feature) {
    case 15:
        BaseAttackSpeed = (float) value;
        break;
}
 
C++:
float BaseAttackSpeed = 0f;

float (*old_BaseAttackSpeed)(void *instance);
float AttackSpeed(void *instance) {
    if (instance == nullptr) return;
  
    //float original_BaseAttackSpeed = old_BaseAttackSpeed(instance); // original value
  
    return BaseAttackSpeed; // Modded
}

//HOOK_LIB("libil2cpp.so", "0x13707D4", AttackSpeed, old_BaseAttackSpeed);
// Idk why you use HOOK_LIB when you can use HOOk

HOOK("0x13707D4", AttackSpeed, old_BaseAttackSpeed);


OBFUSCATE("15_SeekBar_AttackSpeed_0_10"),


switch (feature) {
    case 15:
        BaseAttackSpeed = (float) value;
        break;
}

Thanks, 0f didn't work, so I fixed it to 1.0f
 
Back
Top Bottom