How do I make a script where if I hover my cursor at somebody's torso, it shows their Roblox user

Read title. I’m not an expert at scripting but some help would be nice. So like for example, if I just moved my cursor to the player’s torso, it shows their username on my cursor if that makes any sense. My friend really needs a script for it, so I thought it would be kind to get some help and make his day.

1 Like

Utilize workspace:ViewportToRay(). Then, check if the result.Instance.Parent is a player character using Players:GetPlayerFromCharacter(). Then update your GUI.

1 Like

If you want to get the object that the player has their mouse on, you should use Mouse.Target

For your convencience, I will link some related posts to this exact concern.

Hopefully this helps you resolve the issue. If you have any questions please don’t hesitate to ask.

Ah yes sorry, Mouse.Hit is better than ViewportToRay()