M MY Multiplayer: Wiki
Side
Kind

getPedAnimation

Client

Tells which setPedAnimation animation a ped is playing on this client.

string|false getPedAnimation(ped ped)

Parameters

NameTypeDescription
pedpedThe ped or player.

Returns

The block's name, the animation's name and a table with the options (time, loop, updatePosition, interruptable, freezeLastFrame, blendTime, restoreTaskOnAnimEnd). false if the ped plays none.

An animation with loop or freezeLastFrame still counts as playing while the ped is streamed out.

Example

local block, anim, options = getPedAnimation(localPlayer)
if block then
    outputDebugString(("%s/%s, looped: %s"):format(block, anim, tostring(options.loop)))
end

See also