OnPlayerJoin

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 22:31, 14 August 2026 by QCherry (talk | contribs) (Update Lua event reference)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

onPlayerJoin

Triggered after a client has joined the server and received its authoritative player ID.

Availability

This event is available in server-side scripts.

Callback signature

onPlayerJoin(playerId)

Parameters

Name Type Description
playerId int The authoritative ID assigned to the joining player.

Examples

Handle the event:

addEventHandler("onPlayerJoin", root, function(playerId)
    outputChatBox("Welcome to the server!", playerId, 225, 195, 110)
end)

Notes

  • The player may still be loading the game world; use onPlayerChatReady for chat UI readiness.