# ENTITY::_GET_LAST_ENTITY_TO_DAMAGE_ENTITY

- **Hash:** `0xAF72EC7E1B54539B`
- **Namespace:** ENTITY
- **Runtime name (Lua/JS):** `GetLastEntityToDamageEntity`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1311
- **URL:** https://natives.borderlinerp.com/natives/ENTITY/_GET_LAST_ENTITY_TO_DAMAGE_ENTITY

## Signature

```c
Entity _GET_LAST_ENTITY_TO_DAMAGE_ENTITY(Entity entity);
```

## Parameters

- `entity` (`Entity`)

## Returns

`Entity`

## Description

*Source: alloc8or RDR3 NativeDB*

Returns the last entity that dealt damage to the specified entity.
Returns 0 if no valid attacker is found.

*Source: VORPCORE RDR3natives*

Returns the last entity that dealt any damage to the specified entity.
This native appears to retrieve the attacker responsible for the most recent damage event on the given entity.

## Usage

### Lua

```lua
local retval = GetLastEntityToDamageEntity(entity)

-- always available, by hash
local retval = Citizen.InvokeNative(0xAF72EC7E1B54539B, entity, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetLastEntityToDamageEntity(entity);

// by hash
const retval = Citizen.invokeNative('0xAF72EC7E1B54539B', entity, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0xAF72EC7E1B54539B, entity);
```

- The name is a community guess and may change. If the named call is missing in your client build, use `InvokeNative` with the hash — it always works.

*Sources: alloc8or RDR3 NativeDB, VORPCORE RDR3natives.*
