Advertisement
ColdSpecs

bb

Jun 24th, 2024
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. -- Function to apply highlight to the head
  2. local function applyHighlight(part)
  3. if part.Name == "Head" and part.Parent:FindFirstChild("HumanoidRootPart") then
  4. -- Create a new Highlight instance
  5. local highlight = Instance.new("Highlight")
  6. highlight.Adornee = part
  7. -- Set the Highlight properties
  8. highlight.FillColor = Color3.new(1, 1, 1) -- Adjust the color as needed
  9. highlight.FillTransparency = 0.5 -- Adjust transparency as needed
  10. highlight.OutlineColor = Color3.new(1, 0, 0) -- Adjust the color as needed
  11. highlight.OutlineTransparency = 0 -- Adjust transparency as needed
  12. highlight.Parent = part
  13. end
  14. end
  15.  
  16. -- Initial scan of the workspace
  17. for _, part in pairs(workspace:GetDescendants()) do
  18. applyHighlight(part)
  19. end
  20.  
  21. -- Event handler for new parts added to the workspace
  22. workspace.DescendantAdded:Connect(applyHighlight)
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement