OnPlayerMeleeAttack
This hook is triggered when a player performs a melee attack. Returning false will cancel the attack.
public override bool OnPlayerMeleeAttack(PlayerBase player, string victimName)
{
return true;
}
| Parameter | Type | Description |
|---|
player | PlayerBase | The instance of the player performing the attack. |
victimName | string | The name of the target entity being attacked. |
| Type | Description |
|---|
bool | Return true to allow the attack, or false to cancel it. |
public override bool OnPlayerMeleeAttack(PlayerBase player, string victimName)
{
if (victimName == "SafeZone_Target")
{
return false;
}
return true;
}