# setPedCanBeKnockedOffBike (Client)

> Sets whether a ped can be knocked off a bike or motorbike in a crash.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Peds
- **URL**: https://wiki.mymp.gg/en/setPedCanBeKnockedOffBike

## Syntax

```lua
bool setPedCanBeKnockedOffBike(ped ped, bool canBeKnockedOff)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `ped` | `ped` | The ped. It also applies to the element's children. |
| `canBeKnockedOff` | `bool` | `false` so the ped never falls off. |

## Returns

`true` if it was applied to the element. `false` if it is not a ped, or is a player other than the local one.

## Example

```lua
setPedCanBeKnockedOffBike(localPlayer, false)
```

## See also

- [canPedBeKnockedOffBike (Client)](https://wiki.mymp.gg/en/canPedBeKnockedOffBike.md): Tells whether a ped can be knocked off a bike or motorbike in a crash.
- [setPedBikeControl (Client)](https://wiki.mymp.gg/en/setPedBikeControl.md): Sets a ped's skill at riding bikes and motorbikes.
