As I said in my previous reply: "ply" is never defined (basically: doesn't exist) in your code. That is what "LocalPlayer()" is for, since the code is clientside, it will return the player object of the client.
Line 2 in the code should be
local trace = util.TraceLine( util.GetPlayerTrace( LocalPlayer() ) )
as Neku originally had the code.