Hovering over a player would print the name into the output, How would I do that?

So I’m trying to improve my code skills and I need a little advice.
I’ve decided to try and make a script that when you hover over a player it would print their name in the output.

Need a little advice on how the script would work and trying to learn little by little. :slight_smile:

Connect to the Mouse.Moved event and use the Mouse.Target property to check if the part the mouse is targeting is a descendant of a character (has a humanoid).

That’s quite confusing. Can you explain in a bit more detail?

I was thinking using MouseHoverEnter but I’m not sure. I’m still new to this.

Put this in a local script.

local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()

mouse.Moved:Connect(function()
   local target = mouse.Target
   if target and target.Parent:FindFirstChild("Humanoid") then
      print(target.Parent.Name)
   end
end)

OH, okay okay. I get it now. Thanks a lot!

I might change it up a bit and possibly add a GUI when hovering over the player as a little challenge for me.

Ok don’t forget to mark as solution if it works.

1 Like

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