Scenario-attached hand props (e.g. broom from SC_WORLD_HUMAN_STRAW_BROOM_WORKING) stay stuck after ClearPedTasks
Context
TASK_START_SCENARIO_IN_PLACE_HASH (0x524B54361229154F) with SC_WORLD_HUMAN_STRAW_BROOM_WORKING (anims WORLD_HUMAN_BROOM_WORKING_MALE_A/FEMALE_B) spawns and grips a broom prop for the duration. Calling ClearPedTasks(ped) after Wait(duration) stops the animation but does NOT reliably release the prop — it stays visually attached to the ped's hand afterward (confirmed via screenshot of stuck broom).
The fix
The scenario system registers attached props by name, retrievable/detachable via _GET_PED_REGISTER_PROP (0x4D0D2E3D8BC000EB, Entity GetPedRegisterProp(Ped ped, const char* propName, BOOL detachProp)). Passing detachProp = true both detaches it from the ped and returns the entity handle so you can DeleteObject it.
For the broom scenario, the relevant prop names (from discoveries/animations/scenarios/scenario_attached_props.lua) are:
p_broom02x_PH_R_HANDp_broom04x_PH_R_HAND
local prop = Citizen.InvokeNative(0x4D0D2E3D8BC000EB, ped, "p_broom02x_PH_R_HAND", true)
if prop and prop ~= 0 and DoesEntityExist(prop) then
DeleteObject(prop)
end
Alternative: _REMOVE_PED_PROP(ped, propName) (0x3A50753042B6891B) removes it without giving you the handle to delete — GetPedRegisterProp with detachProp=true is preferable since it lets you actually delete the entity rather than just detach it (detach alone can leave a dangling non-networked object in the world).
General pattern
Any WORLD_HUMAN_* scenario whose anim name implies a held tool/prop (broom, axe, banjo, bucket, sledgehammer, etc.) likely has a corresponding *_PH_R_HAND/*_PH_L_HAND/*_XH_R_HAND00 entry in scenario_attached_props.lua. After ClearPedTasks following such a scenario, proactively call GetPedRegisterProp(ped, propName, true) for the relevant prop name(s) and delete any returned entity — don't assume the engine cleans it up.
Linked natives
_GET_PED_REGISTER_PROP(0x4D0D2E3D8BC000EB)_REMOVE_PED_PROPITEM_CONDITONAL_ANIM(0x3A50753042B6891B)TASK_START_SCENARIO_IN_PLACE_HASH(0x524B54361229154F)
Tags: scenarios, props, cleanup, clearpedtasks, broom, attached-prop
Category: discoveries
Created: 2026-06-12T22:36:39.912Z