I have tried to make a GUI that, when your mouse cursor hovers over another player, it shows their name, and when you hover off, it disappears. I've tried a couple things, but I can't seem to make it work. Here's my current code, and feel free to do whatever you need to do- even a small hint will help. :happy:
local players = game:GetService("Players") local gui = script.Parent local player = players.LocalPlayer local mouse = player:GetMouse() mouse.Move:connect(function() do end)
You'll need to check mouse.Target which hosts the object the mouse is pointing to. Also, I suggest you create a textlabel of some sort. However, this will put you on the right track.
Code:
local players = game:GetService("Players") local gui = script.Parent local player = players.LocalPlayer local mouse = player:GetMouse() mouse.Move:connect(function() do local target = mouse.Target if target and target.Parent:FindFirstChild("Humanoid") then local plr = game.Players:GetPlayerFromCharacter(target.Parent) if plr and plr ~= player then print(plr.Name) end end end)