CORRECTION: The script does work, but how can I get it to display the GUI right next to the mouse, and display their rank in a group as well?
local Player=game.Players.LocalPlayer
local gui = script.Parent.Frame
repeat wait() until Player and Player.Character and wait(5)
local Character=Player.Character
local mouse=Player:GetMouse()
local hoverPlayer = false
mouse.Move:connect(function()
if mouse.Target ~= nil then
local humanoid, player = mouse.Target.Parent:findFirstChild("Humanoid"), game.Players:FindFirstChild(mouse.Target.Parent.Name)
if humanoid and player then
if not hoverPlayer then
gui.NameLabel.TextColor3 = player.TeamColor.Color
gui.NameLabel.Text = humanoid.Parent.Name
gui.HealthLabel.Text = math.ceil(mouse.Target.Parent.Humanoid.Health / mouse.Target.Parent.Humanoid.MaxHealth * 100) .."%"
hoverPlayer = true
end
else
hoverPlayer = false
gui.NameLabel.Text = ""
gui.HealthLabel.Text = ""
end
end
end)

1 comment
So your issue is solved?