MouseOver Text with a player?

Hello!

I am wondering how I can get a player to have their mouse hover over another player, and it shows the players name. If there is a tutorial, let me know!

Thanks!

Sincerely,

papahetfan

Try using this for players.

You could make a client script using Mouse.Move to check when the player has moved their mouse, and then , within the function, you could hide/show the player name [check if the mouse.Target is a character of a valid player]

1 Like
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Mouse = Player:GetMouse()
local db = false


Mouse.Move:Connect(function()
	local Target = Mouse.Target
	if Target == nil then return end
	print(Target)
	if Target:FindFirstAncestorWhichIsA("Model") then
		if Players:FindFirstChild(Target:FindFirstAncestorWhichIsA("Model").Name) then
			if Target:FindFirstAncestorWhichIsA("Model"):FindFirstChild("Humanoid") then
				if not db then
					Target:FindFirstAncestorWhichIsA("Model"):FindFirstChild("Humanoid").DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
					task.wait(3)
					db = true
				else
					Target:FindFirstAncestorWhichIsA("Model"):FindFirstChild("Humanoid").DisplayDistanceType = Enum.HumanoidDisplayDistanceType.Viewer
					task.wait(3)
					db = false
				end	
			end
		end
	end
end)

A basic example. You can modify and edit it.
Or just watch the vids above.

Instead of Mouse.Button1Down you can use Mouse.Move or an event loop.

Where would I put this Script in?