General > Developers Corner

question with on join chat text box

(1/1)

kaos2100:
Will this work when a player joins it should replace the normal "Player has joined the server"


--- Code: ---hook.Add("PlayerAuthed", "joinMsg", function(ply, sid)
    local nick = ply:Nick()
    local group = ply:GetUserGroup()
        if CLIENT then
                chat.AddText( Color( 255, 204, 51 ), "["..group.."] ", Color( 255, 255, 255 ), nick, Color( 255, 204, 51 ), " ("..sid..") ", Color( 255, 255, 255 ), "has joined the server!" )
        end
end)

--- End code ---

Navigation

[0] Message Index

Go to full version