winstxnhdw / lc-hax

A powerful, feature-rich and highly performant internal cheat for the co-op indie horror video game, Lethal Company.
87 stars 26 forks source link

make entities not attack players #76

Closed AverageVirusTotalEnjoyer closed 9 months ago

winstxnhdw commented 9 months ago

Might be possible but it doesn't look trivial, so I am going to put this on the backlog.

AverageVirusTotalEnjoyer commented 9 months ago

alright

MichaelDavidGK commented 9 months ago
public static bool Prefix(ref bool __result, EnemyAI __instance, PlayerControllerB playerScript, bool cannotBeInShip = false, bool overrideInsideFactoryCheck = false)
{
    if ((GameNetworkManager.Instance.localPlayerController.playerSteamId == playerScript.playerSteamId) && Settings.SETTINGS_UNTARGETABLE)
    {
        __result = false;
        return false;
    }
    return true;
}

@winstxnhdw I found a nice and easy example ;)

winstxnhdw commented 9 months ago

Which method is this?

EDIT:

Likely, PlayerIsTargetable.

winstxnhdw commented 9 months ago

Okay. I have added this. It's /block enemy. Thanks @MichaelDavidGK!