Dota 2 Workshop Tools/Scripting/API/Global.ListenToGameEvent

From Valve Developer Community
Jump to: navigation, search
Note.png 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.png Tip: In addition to listening for standard engine events, you can also create your own events by placing them in /scripts/custom_events.txt.

ListenToGameEvent('entity_killed', Dynamic_Wrap(MyCustomGameMode, 'OnEntityKilled'), self)


Type Name Description
string EventName No Description Set
handle functionNameToCall No Description Set
handle context No Description Set


int - a handle for the event/function pair