Mouse.Target prints everything

Hi, I have Mouse.Target
and i said if Mouse.Target.Name == “UpperTorso” or “Head” then
print only those 2
what happens is it prints everything the mouse.target catches

--   Mouse.Move:Connect(function()
	if Mouse.Target == "UpperTorso" or "Head" then
		local Char =Mouse.Target
		print(Char)
	end
end)
3 Likes

if statement doesn’t even works

3 Likes

your if statement is messed up:

it will always be true because if “Head” is always true. instead you’ll need to do

if Mouse.Target.Name == "UpperTorso" or Mouse.Target.Name == "Head" then

I also added .Name because thats how you should be detecting.

3 Likes

Yeah also the char will be mouse.target.parent

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.