I have a script but it doesnt work, how can I get it to work with Filtering Enabled?
Asked by
6 years ago Edited 6 years ago
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?
01 | local Player = game.Players.LocalPlayer |
02 | local gui = script.Parent.Frame |
04 | repeat wait() until Player and Player.Character and wait( 5 ) |
06 | local Character = Player.Character |
07 | local mouse = Player:GetMouse() |
08 | local hoverPlayer = false |
10 | mouse.Move:connect( function () |
11 | if mouse.Target ~ = nil then |
12 | local humanoid, player = mouse.Target.Parent:findFirstChild( "Humanoid" ), game.Players:FindFirstChild(mouse.Target.Parent.Name) |
13 | if humanoid and player then |
14 | if not hoverPlayer then |
15 | gui.NameLabel.TextColor 3 = player.TeamColor.Color |
16 | gui.NameLabel.Text = humanoid.Parent.Name |
17 | gui.HealthLabel.Text = math.ceil(mouse.Target.Parent.Humanoid.Health / mouse.Target.Parent.Humanoid.MaxHealth * 100 ) .. "%" |
22 | gui.NameLabel.Text = "" |
23 | gui.HealthLabel.Text = "" |