local handle = script.Parent.Handle
script.Parent.Activated:Connect(function()
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local target = mouse.Target
if target.Name == "Well Water" then
local fishray = Ray.new(handle.Position,(handle.CFrame.p - mouse.Hit.p).unit * 100)
local part, position = workspace:FindPartOnRay(fishray, plr.Character)
if part and part.Name == ("Well Water") then
print "success"
end
end
end)
✓ ANSWER ACCEPTED
How to get the part that a ray hits?
1 answer
✓ Accepted answer
That most likely means a part isn't being found.
For your if command, do
if part and part.Parent and Part.Name == "Well Water" then
--code
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
So how do I find the part? I'll post the basic script.
You find it by using FindPartOnRay. A ray won't always find a part, if you fire it towards the sky, it will return nil.