setPedShootAt
Replaces the owned ped's primary task with GTA's native coordinate GunControl firing task.
Syntax
bool setPedShootAt(ped thePed, Vector3 target [, int duration = 1000, int burstLength = 5])GTA task mapping
0668 CTaskSimpleGunControlSCM equivalent: TASK_SHOOT_AT_COORD
GunControl receives the coordinate and FIREBURST command directly, then creates its own CTaskSimpleUseGun attack subtask. Negative durations remain indefinite.
Arguments
thePedpedLiving streamed ped simulated by this client.
targetVector3Finite target; an XY value of 0,0 is rejected because GTA treats it as no coordinate.
durationintoptional · default 1000Milliseconds; every negative value is indefinite.
burstLengthintoptional · default 5Positive native burst size.
Returns
true when the native task was installed; false for failed ownership, liveness, target, or burst validation.
Ownership and lifecycle
Low-level ped task calls require the client that simulates the living, streamed ped. Driving tasks also require control of the streamed vehicle. They do not create lifecycle handles; the optional native-task-runtime adds server-owned route epochs and reconstruction for drive_to routes. Gang-tag ownership is resource-exclusive, survives object streaming and recreation, and is released automatically when the owner stops.
OOP aliases
ped:setShootAt(target, duration, burstLength)
Where this comes from
Continue exploring
← Back to the Neon Lua API · How Native ped tasks and gang tags works →