local mouse = game.Players.LocalPlayer:GetMouse()
if mouse.Target ~= nil then
if mouse.Target.Parent:FindFirstChild("Humanoid") then
print("FOUND HIM!")
end
end
doesn't tell me anything, that's all of the code by the way.
local mouse = game.Players.LocalPlayer:GetMouse()
if mouse.Target ~= nil then
if mouse.Target.Parent:FindFirstChild("Humanoid") then
print("FOUND HIM!")
end
end
doesn't tell me anything, that's all of the code by the way.
In some instances, if you targeted a players hat, the parent would be Head, which does not contain a Humanoid, if you want to find the humanoid, here is an example:
function FindBase(top)
--you could upvalue workpace or use the preset global variable Workspace/workspace
local workspace = game:GetService("Workspace")
while (top.Parent ~= workspace) do
top = top.Parent
--could add wait, if you wanted
end
return top
end
local mouse = game.Players.LocalPlayer:GetMouse()
if mouse.Target ~= nil then
local base = FindBase(mouse.Target)
if (base:FindFirstChild("Humanoid")) then
print("Gotem coach")
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.