Think hook with ply function??

Hello guys

i’m trying to make : ply works in a Think hook

hook.Add( “Think”, “PlyThink”, function(ply)

	local trace = LocalPlayer():GetEyeTrace()
	if input.IsKeyDown( KEY_M ) then
	ply.ChoipeauxOpen = true

end )

But i get this error: attempt to index local ‘ply’ (a nil value)

Player object isn’t passed by the Think hook. Since you’re doing this on the client just make a local variable and set that.

Use PlayerTick.