First, "repeat wait() until game.Players.LocalPlayer" is:
1) Busy-waiting (very very inefficient)
2) Unnecessary. There should be no situation where a localscript is running and LocalPlayer is nil.
Next, "repeat wait() until player.Character"
This is at least necessary, but is still busy-waiting.
Consider player.CharacterAdded:wait()
This will allow the script to simply wait until the character is added, rather than checking every frame.
Lastly, lookVector is indeed read-only.
Consider using CFrame.new(Vector3 OriginalPosition, Vector3 TargetPosition) to make a CFrame "looking at" a target. |