I’ve made medkit system so if you hold left click on a player it heals them until you release the button or they reach max health. This only works on other players/humanoids but not my own character.
The system uses mouse.Target to detect if there is a player
while task.wait(.1) do
if equipped then
if mouse.Target then
if mouse.Target.Parent then
if mouse.Target.Parent:FindFirstChildOfClass("Humanoid") then
target = mouse.Target.Parent
if (plr.Character.HumanoidRootPart.Position - target.HumanoidRootPart.Position).Magnitude < 20 then
end
end
end
end
end
Unfortunately due to the way characters work, Mouse.Hit and Mouse.Target inherently ignore limbs. You could get around this by raycasting from the mouse position using Camera:ScreenPointToRay and UserInputService:GetMouseLocation to get the appropriate ray at the mouse position in 3D space.
Weld an invisible massless part to your character that has no coliision and covers the character entirely. Part should be in a folder in workspace and not your character so it won’t be ignored.
I think for percision I would use this method for other characters as well since it’s hard to click on mobile.