NightGolden

Untitled

Mar 12th, 2023
1,710
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. local Players = game:GetService("Players"):GetChildren()
  2. local RunService = game:GetService("RunService")
  3. local highlight = Instance.new("Highlight")
  4. highlight.Name = "Highlight"
  5.  
  6. for i, v in pairs(Players) do
  7. repeat wait() until v.Character
  8. if not v.Character:FindFirstChild("HumanoidRootPart"):FindFirstChild("Highlight") then
  9. local highlightClone = highlight:Clone()
  10. highlightClone.Adornee = v.Character
  11. highlightClone.Parent = v.Character:FindFirstChild("HumanoidRootPart")
  12. highlightClone.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  13. highlightClone.Name = "Highlight"
  14. end
  15. end
  16.  
  17. game.Players.PlayerAdded:Connect(function(player)
  18. repeat wait() until player.Character
  19. if not player.Character:FindFirstChild("HumanoidRootPart"):FindFirstChild("Highlight") then
  20. local highlightClone = highlight:Clone()
  21. highlightClone.Adornee = player.Character
  22. highlightClone.Parent = player.Character:FindFirstChild("HumanoidRootPart")
  23. highlightClone.Name = "Highlight"
  24. end
  25. end)
  26.  
  27. game.Players.PlayerRemoving:Connect(function(playerRemoved)
  28. playerRemoved.Character:FindFirstChild("HumanoidRootPart").Highlight:Destroy()
  29. end)
  30.  
  31. RunService.Heartbeat:Connect(function()
  32. for i, v in pairs(Players) do
  33. repeat wait() until v.Character
  34. if not v.Character:FindFirstChild("HumanoidRootPart"):FindFirstChild("Highlight") then
  35. local highlightClone = highlight:Clone()
  36. highlightClone.Adornee = v.Character
  37. highlightClone.Parent = v.Character:FindFirstChild("HumanoidRootPart")
  38. highlightClone.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  39. highlightClone.Name = "Highlight"
  40. task.wait()
  41. end
  42. end
  43. end)
Add Comment
Please, Sign In to add comment