Advertisement
ColdSpecs

Untitled

Oct 9th, 2023
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. local plr = game:service "Players".LocalPlayer
  2. local highlights = Instance.new("Folder", game:service "CoreGui")
  3. local function addhighlight(object)
  4. if object:IsA "Model" and object.Parent.Name ~= tostring(plr.TeamColor) then
  5. local head = object:FindFirstChild("Head")
  6. local torso = object:FindFirstChild("Torso") or object:FindFirstChild("UpperTorso")
  7. if head and torso then
  8. for _, part in pairs({head, torso}) do
  9. local highlight = Instance.new("Highlight", highlights)
  10. highlight.Adornee = part
  11. highlight.FillColor = Color3.new(1, 1, 1)
  12. highlight.FillTransparency = .75
  13. highlight.OutlineTransparency = 0
  14. part.AncestryChanged:Connect(
  15. function()
  16. highlight:Destroy()
  17. end
  18. )
  19. end
  20. end
  21. end
  22. end
  23. for _, v in pairs(workspace:GetDescendants()) do
  24. addhighlight(v)
  25. end
  26. workspace.DescendantAdded:Connect(addhighlight)
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement