When I try this script in studio:
print(game.Players.LocalPlayer:GetMouse().Target.Name)
and my mouse is pointing at my torso, it prints Baseplate and won't detect my torso. Anyway to make it detect my torso and not the baseplate?
Thanks!
mouse events and even a ClickDetector can't detect your own torso, but it sure can detect other players' torsos. One thing you could do is weld a part to the torso and store it outside of the character, then check for it separately.
i.e.
local player = game.Players.LocalPlayer local mouse = player:GetMouse() repeat wait() until player.Character local torso = player.Character:WaitForChild('Torso') local t = torso:Clone() t.Name = 'TorsoClone' t.Transparency=1 t.CanCollide=false local weld = Instance.new('Weld') weld.Part0=torso weld.Part1=t weld.Parent=t t.Parent=workspace mouse.Button1Down:connect(function() local target = mouse.Target print(target.Name) end)