Homegames Try setting the entity immune from all damage first ( again, this is all in the Syntax list clearly explained )
SETENTITYIMMUNE=X
Description: This sets whether the entity is immune to damage or not.
Range: X = 0 – entity can receive damage,
X = 1 – entity is immune to damage.
Example: :state=0:setentityimmune=1
Then use the command "damagby=indirect" when a barrel explodes. I have not tested this yet, but you might have to set the entity to "setentityimmune=0" when barrel explodes
right before or after the command "damageby=x"
DAMAGEBY=X
Description: Is true when the entity has been damaged by the weapon defined,
the slot number defined, or the text “collision”, “melee”, “indirect”, “flak” or
“falling”.
Range: X = File path of the weapon,
X = The weapon slot number,
X = “collision” – True if entity was damaged by a collision event (such as
a crate falling on them),
X = “falling” – True if entity was damaged by falling,
X = “flak” – True if entity was damaged by flak,
X = “indirect” – True if entity was damaged by an indirect event (such as
a barrel exploding),
X = “melee” – True if entity was damaged by a melee attack
As I said, I have not tested this as of yet
Let me know if it works for you.
** WHERE'S MY eXplosys ? **