local mouse = game.Players.LocalPlayer:GetMouse()
local p = workspace.part
local plr = {"Head","Torso","Right Arm","Left Arm","Right Leg","Left Leg","HumanoidRootPart"}
while true do
wait()
if mouse.Target == nil or mouse.Target == p then
script.Parent.Value = ""
elseif mouse.Target.Name == plr[1] or mouse.Target.Name == plr[2] or mouse.Target.Name == plr[3] or mouse.Target.Name == plr[4] or mouse.Target.Name == plr[5] or mouse.Target.Name == plr[6] or mouse.Target.Name == plr[7] then
script.Parent.Value = (mouse.Target.Parent.Name)
else
script.Parent.Value = mouse.Target.Name
end
end
Everything works, it just looks messy with elseif mouse.Target.Name == plr[1] or mouse.Target.Name == plr[2] or mouse.Target.Name == plr[3] or mouse.Target.Name == plr[4] or mouse.Target.Name == plr[5] or mouse.Target.Name == plr[6] or mouse.Target.Name == plr[7] then
Would there be an easier way to do that?
