Here’s everything you can copy/paste:
Step 1 – First IF requirement (damage detection)
Requirement: Is Number
- Comparison mode:
smaller-than - Number:
{"placeholder":"current_player_health_percent"} - Compare with:
{"placeholder":"getvariable","values":{"name":"prev_health_percent"}}
Inside that IF keep the actions you already have:
health_flash_timer:10
health_flash_alpha:1
Step 2 – Second IF requirement (reset prev value)
Requirement: Is Number
- Comparison mode:
equals - Number:
{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - Compare with:
0
Inside that IF set this action:
prev_health_percent:{"placeholder":"current_player_health_percent"}
Step 3 – Always-running actions (no IF)
Add these two actions after the IF blocks:
health_flash_timer:{"placeholder":"maxnum","values":{"first":"0","second":"{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} - 1"}}"}}
health_flash_alpha:{"placeholder":"calc","values":{"decimal":"true","expression":"{"placeholder":"getvariable","values":{"name":"health_flash_timer"}} / 10"}}
Optional debug text element:
{"placeholder":"getvariable","values":{"name":"health_flash_timer"}}
Let me know if you want me to wrap these into a full action script snippet.