# setElementVelocity (Shared)

> Sets an element's velocity.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Elements
- **URL**: https://wiki.mymp.gg/en/setElementVelocity

## Syntax

```lua
bool setElementVelocity(element element, float x, y, z)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `element` | `element` | The ped, player, vehicle or object. |
| `x, y, z` | `float` | Velocity along each axis, in units per simulation step. |

## Returns

`true` if it was set, `false` if the element has no velocity.

## Example

```lua
bindKey("space", "down", function()
    local vehicle = getPedOccupiedVehicle(localPlayer)
    if vehicle then
        local velocity = getElementVelocity(vehicle)
        setElementVelocity(vehicle, velocity.x, velocity.y, velocity.z + 0.3)
    end
end)
```

## See also

- [getElementVelocity (Shared)](https://wiki.mymp.gg/en/getElementVelocity.md): Returns an element's velocity.
- [setElementAngularVelocity (Shared)](https://wiki.mymp.gg/en/setElementAngularVelocity.md): Sets an element's turning speed.
- [setElementFrozen (Shared)](https://wiki.mymp.gg/en/setElementFrozen.md): Freezes or unfreezes an element and all its children.
