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

Need protected areas on your map?

Viper Safe-Zone draws polygon safe zones in-game — no hand-edited coordinates — with weapon, combat and vehicle-speed rules per zone.

See Viper Safe-Zone →