Why are you trying to get the Target of the Humanoid?
There is no such thing. There is only the TargetPoint, which doesn't exist unless you order the Humanoid to move, and even then it's irrelevant to this topic.
You want the mouse.Hit, and that's easy to get from a local script.
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.Button1Down:connect(function()
print(mouse.Hit) -- this is a CFrame value, to get just the position (x,y,z) in a Vector3, then say mouse.Hit.p
end) |