M MY Multiplayer: Wiki
Side
Kind

setServerPassword

Server

Changes the password to join the server. Players already in stay.

bool setServerPassword([string password = nil])

Parameters

NameTypeDescription
passwordstringThe new password. Without it, or empty, the server is open.default nil

Returns

true once the password is set; false if it is over 32 characters long or has a space.

Example

addCommandHandler("lock", function(player, command, password)
    setServerPassword(password)
end)

See also