TaskPerformSequenceFromProgress
DocsTaskPerformSequenceFromProgress(ped, taskIndex, progress1, progress2)Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | The ped to perform the task on |
taskIndex | int | — |
progress1 | int | The progress to start from |
progress2 | int | Unknown what it does, it has to be set higher than 0 to not break the sequence |
Quick Snippet: Get Ped Handleped
pedUse 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

mp_m_freemode_01
player_zero
ig_agatha
s_m_y_cop_01
s_m_m_gaffer_01
g_m_m_armboss_01
a_c_boar
a_m_m_bevhills_01Returns
voidThis native does not return a value.
Examples
Official
Citizen.CreateThread(function()
local animDict = 'timetable@ron@ig_5_p3'
RequestAnimDict(animDict)
while not HasAnimDictLoaded(animDict) do
Wait(0)
end
local ped = PlayerPedId()
local pos = GetEntityCoords(ped)
-- you can change the model, but you might have to change the offsets below.
local objModelHash = `prop_bench_01a`
local obj = GetClosestObjectOfType(pos.x, pos.y, pos.z, 5.0, objModelHash, false, false, false)
if obj == 0 then
print("No valid object within range!")
return
end
local tgtPos = GetOffsetFromEntityInWorldCoords(obj, 0.0, -0.7, 0.0)
-- open the task sequence so we can get our sequence id
local sequence = OpenSequenceTask()
local desiredHeading = GetEntityHeading(obj) - 180.0
-- go to the entities offset
TaskGoStraightToCoord(nil, tgtPos.x, tgtPos.y, tgtPos.z, 1.0, 4000, desiredHeading, 1.0)
-- sit on the bench indefinitely (you can change -1 here to however long you want to sit)
TaskPlayAnim(nil, animDict, 'ig_5_p3_base', 8.0, 8.0, -1, 1)
-- close the sequence so we can perform it
CloseSequenceTask(sequence)
-- perform the sequence, this will not work if the sequence is still open.
-- note that progress1 is set to 1, this means it will skip the first sequence
TaskPerformSequenceFromProgress(ped, sequence, 1, 1)
-- free the sequence slot so it can be re-used
ClearSequenceTask(sequence)
-- cleanup the animation dict so the engine can remove it when its no longer needed
RemoveAnimDict(animDict)
end)