I need help with my command addon!

What is supposed to happen
So, i made an addon which has to create a command, once you execute the command, it’s supposed to say in the chat “Hello! (the player’s name)”

What is happening
Dosen’t create the command and gives me the following error: "
[ERROR] addons/myaddon/lua/autorun/server/sv_myaddon.lua:5: syntax error near ‘net’

  1. unknown - addons/myaddon/lua/autorun/server/sv_myaddon.lua:0
    " and i don’t see any bad things near ‘net’

Codes

Server



util.AddNetworkString( "myMessage" )
concommand.Add( "sayhi", function( ply, cmd, args, str )
print( ply:Nick() )
	net,Start( "myMessage" )
	net:WriteEntity( ply )
	net.Broadcast()
end )



Client



net.Receive( "myMessage", function( len, ply )
	local ply = net.ReadEntity()
	 chat.AddText( Color(0, 255, 0), "Hello " .. ply:Nick() )
end )


You have a comma at net.Start.

Commands called from client, are executed in client, you have to do net.SendToServer(), not net.Broadcast()

Also you don’t need to write the player, because you know ply is LocalPlayer() and inside net.Receive if it were called in client side, the second parameter will be the player that called that netmessage

Actually, the error was that i had net,Start, net:WriteEntity, net:Broadcast instead of net.Start, net.WriteEntity and net.Broadcast. Thank you anyways for taking your time.

Thanks for noticing a little mistake.