Advertisement
Vzurxy

Untitled

Jan 26th, 2019
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local LocalPlayer = Players.LocalPlayer
  3. local Character = LocalPlayer.Character
  4.  
  5. function randomString(Min, Max)
  6. local length = math.random(Min, Max)
  7. local array = {}
  8. for i = 1, length do
  9. array[i] = string.char(math.random(32, 126))
  10. end
  11. return table.concat(array)
  12. end
  13.  
  14. function Tracers()
  15. for i,v in pairs(Players:GetPlayers()) do
  16. if v.Character and v.Character:FindFirstChild("HumanoidRootPart") and not v.Character.HumanoidRootPart:FindFirstChild("Attachment") then
  17. local Beam = Instance.new("Beam", LocalPlayer.Character.HumanoidRootPart)
  18. Beam.Width0 = 0.15
  19. Beam.Width1 = 0.15
  20. Beam.Name = randomString(20, 40)
  21. Beam.FaceCamera = true
  22. Beam.Color = ColorSequence.new(v.TeamColor.Color, v.TeamColor.Color)
  23. One = Instance.new("Attachment", LocalPlayer.Character.HumanoidRootPart)
  24. Two = Instance.new("Attachment", v.Character.HumanoidRootPart)
  25. Beam.Attachment0 = One
  26. Beam.Attachment1 = Two
  27. end
  28. end
  29. end
  30.  
  31. Tracers()
  32.  
  33. CheckIfHasTracer = workspace.ChildAdded:Connect(function(NewObject)
  34. if Players:FindFirstChild(NewObject.Name) then
  35. wait(0.3)
  36. repeat wait() until LocalPlayer.Character and LocalPlayer.Character:FindFirstChildOfClass("Humanoid") and LocalPlayer.Character:FindFirstChildOfClass("Humanoid").Health > 0
  37. Tracers()
  38. end
  39. end)
  40.  
  41. function HumanoidDied()
  42. ReplaceTracers = workspace.ChildRemoved:Connect(function(NewObject)
  43. if NewObject.Name == LocalPlayer.Name then
  44. for i,v in pairs(Players:GetPlayers()) do
  45. if v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
  46. for k,d in pairs(v.Character:GetChildren()) do
  47. v.Character.HumanoidRootPart:ClearAllChildren()
  48. end
  49. end
  50. end
  51. repeat wait() until LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
  52. Tracers()
  53. HumanoidDied()
  54. end
  55. end)
  56. end
  57.  
  58. HumanoidDied()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement