Dota 2 Workshop Tools/Scripting/API/Global.ListenToGameEvent
< Dota 2 Workshop Tools | Scripting | API
Note: This page is automatically generated. Any changes may be overwritten
Function Description
int ListenToGameEvent(string EventName, handle functionNameToCall, handle context)
Register as a listener for a game event from script.
Tip:In addition to listening for standard engine events, you can also create your own events by placing them in /scripts/custom_events.txt.
- Example
ListenToGameEvent('entity_killed', Dynamic_Wrap(MyCustomGameMode, 'OnEntityKilled'), self)
Parameters
Type | Name | Description |
---|---|---|
string | EventName | No Description Set |
handle | functionNameToCall | No Description Set |
handle | context | No Description Set |
Returns
int - a handle for the event/function pair