Back to Library
UI Nov 22, 2025

Welcome Message

T
by terrorsoul

Sends a welcome message in the chat when a player joins

LUA
function GreetNewPlayer(player)
    -- Get the new player's name
    local name = tm.players.GetPlayerName(player.playerId)
    
    -- Create the welcome string
    local msg = "Welcome " .. name .. " to the server!"
    
    -- Send it to chat in Green
    tm.playerUI.SendChatMessage("Server", msg, tm.color.Green())
end

-- Register the event
tm.players.OnPlayerJoined.add(GreetNewPlayer)

Discussion

Please log in to post a comment.