Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players"):GetChildren()
- local RunService = game:GetService("RunService")
- local highlight = Instance.new("Highlight")
- highlight.Name = "Highlight"
- for i, v in pairs(Players) do
- repeat wait() until v.Character
- if not v.Character:FindFirstChild("HumanoidRootPart"):FindFirstChild("Highlight") then
- local highlightClone = highlight:Clone()
- highlightClone.Adornee = v.Character
- highlightClone.Parent = v.Character:FindFirstChild("HumanoidRootPart")
- highlightClone.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
- highlightClone.Name = "Highlight"
- end
- end
- game.Players.PlayerAdded:Connect(function(player)
- repeat wait() until player.Character
- if not player.Character:FindFirstChild("HumanoidRootPart"):FindFirstChild("Highlight") then
- local highlightClone = highlight:Clone()
- highlightClone.Adornee = player.Character
- highlightClone.Parent = player.Character:FindFirstChild("HumanoidRootPart")
- highlightClone.Name = "Highlight"
- end
- end)
- game.Players.PlayerRemoving:Connect(function(playerRemoved)
- playerRemoved.Character:FindFirstChild("HumanoidRootPart").Highlight:Destroy()
- end)
- RunService.Heartbeat:Connect(function()
- for i, v in pairs(Players) do
- repeat wait() until v.Character
- if not v.Character:FindFirstChild("HumanoidRootPart"):FindFirstChild("Highlight") then
- local highlightClone = highlight:Clone()
- highlightClone.Adornee = v.Character
- highlightClone.Parent = v.Character:FindFirstChild("HumanoidRootPart")
- highlightClone.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
- highlightClone.Name = "Highlight"
- task.wait()
- end
- end
- end)
Add Comment
Please, Sign In to add comment