• Help with Lua Script.
    5 replies, posted
Hello, I'm trying to make a script that sends a welcome message when a player join. [CODE]local function SendMessage( ply ) local nick = ply:IsConnected():GetName() local Hostname = GetHostName() local message = "Hi there" .. nick .. " welcome to " .. Hostname .. " enjoy your stay!" if ( ply:IsConnected ) do ply:PrintMessage( HUD_PRINTCENTER, message ) end end hook.Add("PlayerWelcomeMessage", "playerwelcomemessage", SendMessage)[/CODE] Can anyone help? Thank you, -Mr.D.M.C
[lua] hook.Add("PlayerInitialSpawn", "Init_WelcomeMessage", function(ply) ply:PrintMessage( HUD_PRINTCENTER, "Hi there " .. ply:Nick() .. " welcome to " .. GetHostName() .. " enjoy your stay!" ); end); [/lua] You should really look into using user messages and send them through this hook.
Thank you for helping. Going to try it now. I got the script from the wiki. -Mr.D.M.C
Please don't sign your posts.
[QUOTE=DrJenkins;34662959]Please don't sign your posts.[/QUOTE] Go be a troll else-where, please.
I'm quite happy here thank you.
Sorry, you need to Log In to post a reply to this thread.