Light on weapon attachments on peds

Hello, im spawning a ped, adding a weapon with flashlight attachment and using TaskGoToEntityWhileAimingAtCoord but the light is off, I have also tried SetFlashLightEnabled and still doesnt work.

Any other idea? I have also tried with other weapon such as WEAPON_FLASHLIGHT