ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
client

TaskGoToCoordAnyMeans

FiveM client native documentation with a Lua example.

Summary

Tells a ped to walk/drive to coordinates by any means. Used for NPC movement in missions and immersion scripts.

Returns

void

Parameters

pednumberThe ped.
x,y,zfloatDestination.
speedfloatMovement speed.
...anyAdditional pathing params.

Example

TaskGoToCoordAnyMeans(npc, x, y, z, 1.0, 0, false, 786603, 0xbf800000)

Common pitfalls

  • The ped needs to be a controllable NPC (not the player usually).
  • Pathfinding can fail on complex terrain; combine with checks.

Related natives

Related guides

FiveM scripts done right

Optimized, dual-framework scripts for QBCore and ESX from Viper Development — escrow protected, delivered instantly to your Cfx portal.

Browse Scripts →