OnClientPlayerJoin: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
This event is when | {{Client event}} | ||
This event is triggered when the local player joins a server. | |||
== | ==Parameters== | ||
''None'' | |||
==Example== | ==Example== | ||
This | This client side script outputs some text to the player when he joins. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function onPlayerJoin () --When the player joins | function onPlayerJoin () -- When the player joins | ||
outputChatBox("We be gangstas!", 255, 0, 0) -- Show him some text | |||
end | end | ||
addEventHandler ( " | addEventHandler ( "onClientPlayerJoin", getRootElement(), onPlayerJoin ) -- add the function as an event handler | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 17:03, 14 September 2007
This event is triggered when the local player joins a server.
Parameters
None
Example
This client side script outputs some text to the player when he joins.
function onPlayerJoin () -- When the player joins outputChatBox("We be gangstas!", 255, 0, 0) -- Show him some text end addEventHandler ( "onClientPlayerJoin", getRootElement(), onPlayerJoin ) -- add the function as an event handler