NativeHubNativeHub
NativesModelsArtifacts

Not affiliated with Rockstar Games or Take-Two Interactive. FiveM and Cfx.re are trademarks of their respective owners. cfxnatives.dev is an independent community project.

Maintained by uz-scripts

© 2026 cfxnatives.dev

contact@cfxnatives.dev
TASKClient
Artifact25963
Data sourced from jgscripts artifact-db

TaskFollowNavMeshToCoord

Docs
TaskFollowNavMeshToCoord(ped, x, y, z, moveBlendRatio, time, radius, flags, finalHeading)

Description

Sometimes a path may not be able to be found. This could happen because there simply isn't any way to get there, or maybe a bunch of dynamic objects have blocked the way,
or maybe the destination is too far away. In this case the ped will simply stand still.
To identify when this has happened, you can use GET_NAVMESH_ROUTE_RESULT. This will help you find situations where peds cannot get to their target.

enum eNavScriptFlags {
    // Default flag
    ENAV_DEFAULT = 0,
    // Will ensure the ped continues to move whilst waiting for the path
    // to be found, and will not slow down at the end of their route.
    ENAV_NO_STOPPING = 1,
    // Performs a slide-to-coord at the end of the task. This requires that the
    // accompanying NAVDATA structure has the 'SlideToCoordHeading' member set correctly.
    ENAV_ADV_SLIDE_TO_COORD_AND_ACHIEVE_HEADING_AT_END = 2,
    // If the navmesh is not loaded in under the target position, then this will
    // cause the ped to get as close as is possible on whatever navmesh is loaded.
    // The navmesh must still be loaded at the path start.
    ENAV_GO_FAR_AS_POSSIBLE_IF_TARGET_NAVMESH_NOT_LOADED = 4,
    // Will allow navigation underwater - by default this is not allowed.
    ENAV_ALLOW_SWIMMING_UNDERWATER = 8,
    // Will only allow navigation on pavements. If the path starts or ends off
    // the pavement, the command will fail. Likewise if no pavement-only route
    // can be found even although the start and end are on pavement.
    ENAV_KEEP_TO_PAVEMENTS = 16,
    // Prevents the path from entering water at all.
    ENAV_NEVER_ENTER_WATER = 32,
    // Disables object-avoidance for this path. The ped may still make minor
    // steering adjustments to avoid objects, but will not pathfind around them.
    ENAV_DONT_AVOID_OBJECTS = 64,
    // Specifies that the navmesh route will only be able to traverse up slopes
    // which are under the angle specified, in the MaxSlopeNavigable member of the accompanying NAVDATA structure.
    ENAV_ADVANCED_USE_MAX_SLOPE_NAVIGABLE = 128,
    // Unused.
    ENAV_STOP_EXACTLY = 512,
    // The entity will look ahead in its path for a longer distance to make the
    // walk/run start go more in the right direction.
    ENAV_ACCURATE_WALKRUN_START = 1024,
    // Disables ped-avoidance for this path while we move.
    ENAV_DONT_AVOID_PEDS = 2048,
    // If target pos is inside the boundingbox of an object it will otherwise be pushed out.
    ENAV_DONT_ADJUST_TARGET_POSITION = 4096,
    // Turns off the default behaviour, which is to stop exactly at the target position.
    // Occasionally this can cause footsliding/skating problems.
    ENAV_SUPPRESS_EXACT_STOP = 8192,
    // Prevents the path-search from finding paths outside of this search distance.
    // This can be used to prevent peds from finding long undesired routes.
    ENAV_ADVANCED_USE_CLAMP_MAX_SEARCH_DISTANCE = 16384,
    // Pulls out the paths from edges at corners for a longer distance, to prevent peds walking into stuff.
    ENAV_PULL_FROM_EDGE_EXTRA = 32768
};

Parameters

NameTypeDescription
pedPedPed Index.
xfloatX Position Coordinate.
yfloatY Position Coordinate.
zfloatZ Position Coordinate
moveBlendRatiofloatRatio for ped movement (0 to 3.0 in the following order: still, walk, run and sprint)
timeintINT value in milliseconds.
radiusfloatdistance from the final coordinates that the pedestrian should be to consider itself at the target.
flagsintNavigation Flags for the ped (see `eNavScriptFlags`).
finalHeadingfloatPeds heading when finished.
📍Quick Snippet: Get Coordinates
xyz

Add this command to your client script to retrieve precise locations in-game.

-- Add this to your client.lua. Type /pos in-game to copy coords.
RegisterCommand('pos', function()
    local ped = PlayerPedId()
    local coords = GetEntityCoords(ped)
    local heading = GetEntityHeading(ped)
    local output = string.format("vector4(%.2f, %.2f, %.2f, %.2f)", coords.x, coords.y, coords.z, heading)

    print(output)
    TriggerEvent('chat:addMessage', { args = { '^4[COORD]^0', output } })
end)
🚶Quick Snippet: Get Ped Handle
ped

Use this to get the player ped handle for this native.

-- Get the player's ped handle (client-side)
local ped = PlayerPedId()
print("Ped handle: " .. ped)

-- For a specific player's ped (server-side):
-- local targetPed = GetPlayerPed(source)
🚶

Ped Models

View All
Mp M Freemode 0 1
mp_m_freemode_01
Player Zero
player_zero
Ig Agatha
ig_agatha
S M Y Cop 0 1
s_m_y_cop_01
S M M Gaffer 0 1
s_m_m_gaffer_01
G M M Armboss 0 1
g_m_m_armboss_01
A C Boar
a_c_boar
A M M Bevhills 0 1
a_m_m_bevhills_01

Returns

void

This native does not return a value.

Server Artifacts

Data sourced from jgscripts artifact-db
Recommended25963
Known Issues24
25987-25988Node.js sandboxing seems to be causing issues for people - best to avoid for now
21547Multiple (unconfirmed) reports of server-sided natives throwing errors or causing crashes; best to avoid
17462Failed build, ignore
16276Multiple reports of issues loading JS within resources
14583-14716Crash when using the new onEntityBucketChange
14583-14862Timeouts due to latency units being in nanoseconds
13759-13890Mumble (voice) external connections blocked by default
13380-13458Server crashing due to integer encoding (PR#3235)
13079Failed Linux build (works OK if using Windows!)
12933-13045Still crashes (sometimes) when restarting resources due to Node.js 22
12913-12932Causes a crash when restarting Node.js 22
12767os.date() appends null terminator; can break Lua scripts
12651Failed Linux build, ignore
12509Failed build, ignore
12255Unconfirmed, but several reports of server-side issues that don't persist when downgrading; best to avoid
12160-12165Cannot use entity native calls in entityRemoved
12151Crashing if using newest title update (TU)
12092-12135SetPlayerModel may cause SIGSEGV crashes on some clients due to changes in player handling. 12031 and below works fine.
12078-12083Some clients will fail to connect with 'ReadBulk of header failed' error
10930Failed build, ignore
10268-10309sv_experimentalNetGameEventHandler enabled by default; can cause server crashing and reports of issues downgrading after upgrading
10191GetVehicleNumberPlateText server native broken, will cause issues with scripts involving vehicles
10072Crashing when players join
8509State bags not replicated to clients

CommunitySnippets

No snippets yet. Be the first to contribute!