OnPlayerJoin: Difference between revisions
Jump to navigation
Jump to search
JonChappell (talk | contribs) No edit summary |
JonChappell (talk | contribs) m (→Example) |
||
Line 4: | Line 4: | ||
==Example== | ==Example== | ||
This example gets the joining client's name and outputs a welcome message including his name once he joins | This example gets the joining client's name and outputs a welcome message including his name once he joins. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> |
Revision as of 04:28, 19 November 2006
This event is triggered when someone joins the server.
Example
This example gets the joining client's name and outputs a welcome message including his name once he joins.
addEventHandler ( "onPlayerJoin", root, "onPlayerJoin" ) function onPlayerJoin ( ) joinplayer = getClientName ( source ) outputChatBox ( "Welcome " ..joinplayer.. " to the Server!" , source, 255, 255, 255 ) end