Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to apply highlight to the head
- local function applyHighlight(part)
- if part.Name == "Head" and part.Parent:FindFirstChild("HumanoidRootPart") then
- -- Create a new Highlight instance
- local highlight = Instance.new("Highlight")
- highlight.Adornee = part
- -- Set the Highlight properties
- highlight.FillColor = Color3.new(1, 1, 1) -- Adjust the color as needed
- highlight.FillTransparency = 0.5 -- Adjust transparency as needed
- highlight.OutlineColor = Color3.new(1, 0, 0) -- Adjust the color as needed
- highlight.OutlineTransparency = 0 -- Adjust transparency as needed
- highlight.Parent = part
- end
- end
- -- Initial scan of the workspace
- for _, part in pairs(workspace:GetDescendants()) do
- applyHighlight(part)
- end
- -- Event handler for new parts added to the workspace
- workspace.DescendantAdded:Connect(applyHighlight)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement