Need help making this into a command.

How would I go about making this into a command?


local ply = LocalPlayer()
chat.AddText( Color( 255, 0, 0 ), "Alright  ", ply, "  Go throw up you first tag behind me... " )

use the concommand library.

Well, I know that. I just don’t know what to put in it.

It will print this if you write hey in console



if CLIENT then
concommand.Add("hey", function() 
local ply = LocalPlayer()
chat.AddText( Color( 255, 0, 0 ), "Alright  ", ply, "  Go throw up you first tag behind me... " )
end)
end

Put that in lua/autorun/

ply is the Player, will return an error.
use ply:GetName() to get the player name (obviously)

Actually, IIRC, Player objects in the chat.AddText function will automatically spit out their name.