Skip to content

onPlayerJoin (Callback)

Sheriff U3 edited this page Oct 28, 2025 · 4 revisions

onPlayerJoin is a callback that may be used only in World Code, it is used to execute the code contained within it when executed.

onPlayerJoin = (playerId, fromGameReset) => {}

Parameters

playerId

playerId is used as a variable that contains the id of the player joining the world in which the code is running. You can replace the playerId in the callback with any other valid variable name. For example: onPlayerJoin = (pId) => {} is also valid. Often to save space a coder will reduce playerId to just p or some other letter.

fromGameReset

Clone this wiki locally