{"hash":"0x374827C2","ns":"CFX","name":"TASK_GO_TO_ENTITY","slug":"TASK_GO_TO_ENTITY","official":true,"named":true,"luaName":"TaskGoToEntity","game":"cfx","apiset":"server","returnType":"void","params":[{"name":"entity","type":"Entity"},{"name":"target","type":"Entity"},{"name":"duration","type":"int"},{"name":"distance","type":"float"},{"name":"speed","type":"float"},{"name":"p5","type":"float"},{"name":"p6","type":"int"}],"summary":"The entity will move towards the target until time is over (duration) or get in target's range (distance).","descriptions":[{"source":"cfx","format":"md","body":"```\nThe entity will move towards the target until time is over (duration) or get in target's range (distance). p5 and p6 are unknown, but you could leave p5 = 1073741824 or 100 or even 0 (didn't see any difference but on the decompiled scripts, they use 1073741824 mostly) and p6 = 0\nNote: I've only tested it on entity -> ped and target -> vehicle. It could work differently on other entities, didn't try it yet.\nExample: TASK::TASK_GO_TO_ENTITY(pedHandle, vehicleHandle, 5000, 4.0, 100, 1073741824, 0)\nPed will run towards the vehicle for 5 seconds and stop when time is over or when he gets 4 meters(?) around the vehicle (with duration = -1, the task duration will be ignored).\n```\n\n**This is the server-side RPC native equivalent of the client native [TASK_GO_TO_ENTITY](?\\_0x6A071245EB0D1882).**"}],"examples":[],"aliases":[],"enums":[],"related":[],"sources":["cfx"],"doc":2,"url":"https://natives.borderlinerp.com/natives/CFX/TASK_GO_TO_ENTITY","markdownUrl":"https://natives.borderlinerp.com/natives/CFX/TASK_GO_TO_ENTITY.md","snippets":{"lua":"TaskGoToEntity(entity, target, duration, distance, speed, p5, p6)","luaInvoke":"Citizen.InvokeNative(0x374827c2, entity, target, duration, distance, speed, p5, p6)","js":"TaskGoToEntity(entity, target, duration, distance, speed, p5, p6);","jsInvoke":"Citizen.invokeNative('0x374827c2', entity, target, duration, distance + 0.0000001, speed + 0.0000001, p5 + 0.0000001, p6);","csharp":"Function.Call((Hash)0x374827c2, entity, target, duration, distance, speed, p5, p6);","notes":["Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason."]}}