Heres what I tried ~~~~~~~~~~~~~~~~~ local Mouse = game.Players.LocalPlayer:GetMouse() Mouse.Moved:connect(function()
if Mouse.Target.Parent:FindFirstChild('Humanoid') then
end
end
Heres what I tried ~~~~~~~~~~~~~~~~~ local Mouse = game.Players.LocalPlayer:GetMouse() Mouse.Moved:connect(function()
if Mouse.Target.Parent:FindFirstChild('Humanoid') then
end
end
The first Problem is that Moved is not a function of the mouse, Move is. Secondly, I don't recommend looking for the humanoid, because this could include NPCs. Check to see if Mouse.Target.Name is able to be found in game.Players
But you can't stop there. The mouse never actually hovers over the model, it hovers over the players body parts (ex LeftArm, RightLeg) so we solve that by doing Mouse.Target.Parent.Name
Here is your finalized script.
local Mouse = game.Players.LocalPlayer:GetMouse()
Mouse.Move:connect(function()
if Mouse.Target ~= nil then --Check to make sure Mouse is not pointing at the sky
if game.Players:FindFirstChild(Mouse.Target.Parent.Name) then --Key Line
print('Found Player: '..Mouse.Target.Parent.Name)
end
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.