Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local LocalPlayer = Players.LocalPlayer
- local Character = LocalPlayer.Character
- function randomString(Min, Max)
- local length = math.random(Min, Max)
- local array = {}
- for i = 1, length do
- array[i] = string.char(math.random(32, 126))
- end
- return table.concat(array)
- end
- function Tracers()
- for i,v in pairs(Players:GetPlayers()) do
- if v.Character and v.Character:FindFirstChild("HumanoidRootPart") and not v.Character.HumanoidRootPart:FindFirstChild("Attachment") then
- local Beam = Instance.new("Beam", LocalPlayer.Character.HumanoidRootPart)
- Beam.Width0 = 0.15
- Beam.Width1 = 0.15
- Beam.Name = randomString(20, 40)
- Beam.FaceCamera = true
- Beam.Color = ColorSequence.new(v.TeamColor.Color, v.TeamColor.Color)
- One = Instance.new("Attachment", LocalPlayer.Character.HumanoidRootPart)
- Two = Instance.new("Attachment", v.Character.HumanoidRootPart)
- Beam.Attachment0 = One
- Beam.Attachment1 = Two
- end
- end
- end
- Tracers()
- CheckIfHasTracer = workspace.ChildAdded:Connect(function(NewObject)
- if Players:FindFirstChild(NewObject.Name) then
- wait(0.3)
- repeat wait() until LocalPlayer.Character and LocalPlayer.Character:FindFirstChildOfClass("Humanoid") and LocalPlayer.Character:FindFirstChildOfClass("Humanoid").Health > 0
- Tracers()
- end
- end)
- function HumanoidDied()
- ReplaceTracers = workspace.ChildRemoved:Connect(function(NewObject)
- if NewObject.Name == LocalPlayer.Name then
- for i,v in pairs(Players:GetPlayers()) do
- if v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
- for k,d in pairs(v.Character:GetChildren()) do
- v.Character.HumanoidRootPart:ClearAllChildren()
- end
- end
- end
- repeat wait() until LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
- Tracers()
- HumanoidDied()
- end
- end)
- end
- HumanoidDied()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement