M MY Multiplayer: Wiki
Side
Kind

getPlayerIdentifier

Server

Returns one of the player's identifiers of a type, such as steam or discord.

string|false getPlayerIdentifier(player player, string type)

Parameters

NameTypeDescription
playerplayerThe player.
typestringThe identifier's type, without the colon: steam or discord.

Returns

The identifier with its prefix, such as steam:110000112345678, or false if the player has none of that type.

Example

addEventHandler("onPlayerJoin", root, function()
    local steam = getPlayerIdentifier(source, "steam")
    outputServerLog(getPlayerName(source) .. " steam: " .. tostring(steam))
end)
NoteThe discord one comes from the player's Discord app and is not verified. The steam one is only verified when the server has a steam_api_key.

See also