I don't think that it fires the event just because the player is attacking.
I tried this in a station and it didn't do anything:
Code: Select all
<OnAttackedByPlayer>
(block (message)
(objSendMessage gPlayerShip Nil "Ouch!")
)
</OnAttackedByPlayer>
It appears that it would be a handy event to make use of like <OnCreate> or <OnObjDestroyed>, but I can't get <OnAttackedByPlayer> to do anything on it's own like <OnCreate> does.
The same code
Code: Select all
<OnAttackedByPlayer>
(block (message)
(objSendMessage gPlayerShip Nil "Ouch!")
)
</OnAttackedByPlayer>
but this does:
Code: Select all
<OnDestroy>
(block (message)
(objSendMessage gPlayerShip Nil "You killed me!")
)
</OnDestroy>