onObjectShot
Description
This event is called when a player shoots an object.
| Name | Description |
|---|---|
| object | The pointer of the object |
| player | The player whom triggered the event |
| weapon | The ID of the weapon |
Example
This example shows a message whenever you shoot an object.
function onScriptLoad() { obj <- CreateObject(....); obj.TrackingShots = true;}function onObjectShot(object, player, weapon) { if(object.ID == obj.ID) { MessagePlayer("You've shot object id " + object.ID + " with weapon id " + weapon, player) }}Notes
💡
Make sure you track those events with object.TrackingShots = true.