Hi,
This is my code:
void CharacterUpdate(void *character){
if(character != NULL) {
bool isAI = *(int *)((uint64_t)character + 0x221); //isAI = 0x221 //Class Character: CharacterBase
if(isAI) { // Check if it's the AI before doing something
if([menu getBool:@"GodmodeSwitch"]) //checking if feature is enabled or not.
return; //return what it normally returns
} else {
*(float *)((uint64_t)character + 0x48) = 99999999; //health = 0x48 //Class CharacterBase
}
}
old_CharacterUpdate(character);
}
MSHookFunction((void*)getRealOffset(0xOffset),(void*)CharacterUpdate,(void**)&old_CharacterUpdate); //Class: CharacterBase -> Func: UpdateCharacter
[menu addSwitchWithIdentifier:@"GodmodeSwitch"
title:@"Godmode"
description:@"You can't die."];
But somehow it doesn't seem to know when it's on or not, it just acts like it's always ON