local Players = game:GetService("Players")
local player = Players.LocalPlayer
Tool = script.Parent
local Mouse = player:GetMouse()
Tool.Activated:Connect(function()
if Tool.Equipped then
if Mouse.Target and Mouse.Target:FindFirstChild("Humanoid") then
local pos1 = Mouse.Target.Position
local pos2 = player.Character.UpperTorso.Position
local magnitude = (pos1 - pos2).magnitude
if magnitude <=13 then
print(Mouse.Target)
end
end
end
end)
I've used almost identicle code when trying to find a click detector with Mouse.Target but I seem to have no luck when trying to do it with a player to get there name.

2 comments
On line 13 it underlines characer and says "Unknown Global 'character' "
just create the variable for character on line 03, like "local character = player.Character"