onClientPlayerJoin | Multi Theft Auto: Wiki Skip to content

onClientPlayerJoin

Client-side
Server-side
Shared

This event is triggered when a player joins a server. It is triggered for all players except the local player, as the local player joins the server before their client-side resources are started. It would also be possible for two players to join within a few seconds of each other and for the two players' scripts may not receive onClientPlayerJoin events as their scripts wouldn't have started yet.

Parameters

This event does not pass any parameters to the handler function.

Source

element: The source of this event is the player that joined the server.

Code Examples

client
function remotePlayerJoin()
outputChatBox("* " .. getPlayerName(source) .. " has joined the server")
end
addEventHandler("onClientPlayerJoin", root, remotePlayerJoin)

See Also