<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tombraidermodlauncher.co.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Engine.AddEventHandler</id>
	<title>Engine.AddEventHandler - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tombraidermodlauncher.co.uk/wiki/index.php?action=history&amp;feed=atom&amp;title=Engine.AddEventHandler"/>
	<link rel="alternate" type="text/html" href="https://wiki.tombraidermodlauncher.co.uk/wiki/index.php?title=Engine.AddEventHandler&amp;action=history"/>
	<updated>2026-04-06T14:59:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://wiki.tombraidermodlauncher.co.uk/wiki/index.php?title=Engine.AddEventHandler&amp;diff=56&amp;oldid=prev</id>
		<title>Jack9267: Created page with &quot;== Function ==  &lt;syntaxhighlight lang=&quot;javascript&quot;&gt; function bool Engine.AddEventHandler(eventName, handler); &lt;/syntaxhighlight&gt;  === Arguments ===  * eventName ** The name of...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.tombraidermodlauncher.co.uk/wiki/index.php?title=Engine.AddEventHandler&amp;diff=56&amp;oldid=prev"/>
		<updated>2014-08-15T20:04:53Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Function ==  &amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt; function bool Engine.AddEventHandler(eventName, handler); &amp;lt;/syntaxhighlight&amp;gt;  === Arguments ===  * eventName ** The name of...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Function ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function bool Engine.AddEventHandler(eventName, handler);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Arguments ===&lt;br /&gt;
&lt;br /&gt;
* eventName&lt;br /&gt;
** The name of the event to listen for. See [[Server Scripting Events]] for some events you can listen for.&lt;br /&gt;
&lt;br /&gt;
* handler&lt;br /&gt;
** The function to call when the event happens.&lt;br /&gt;
&lt;br /&gt;
=== Description ===&lt;br /&gt;
&lt;br /&gt;
This function will add a handler for the event you specify.&lt;br /&gt;
&lt;br /&gt;
=== Returns ===&lt;br /&gt;
&lt;br /&gt;
The function returns &amp;#039;&amp;#039;&amp;#039;true&amp;#039;&amp;#039;&amp;#039; if the handler was successfully added, &amp;#039;&amp;#039;&amp;#039;false&amp;#039;&amp;#039;&amp;#039; otherwise.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Add a handler for when a player joins the server to give them a nice greeting.&lt;br /&gt;
//&lt;br /&gt;
Engine.AddEventHandler(&amp;quot;OnPlayerJoin&amp;quot;,function(player){&lt;br /&gt;
	Engine.OutputChatBox(&amp;quot;Hello &amp;quot; + Engine.GetPlayerName(player) + &amp;quot;, thanks for joining!&amp;quot;,player);&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
Take care with event names as they could be case sensitive in future versions, currently as of 0.1.3 event names are not case sensitive. This could change in the future.&lt;/div&gt;</summary>
		<author><name>Jack9267</name></author>
	</entry>
</feed>