Advertisement
lol_____ok

Untitled

Feb 10th, 2020
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. -- tracer
  2. local folder=Instance.new("Folder",workspace)
  3. folder.Name="Tracers"
  4. function update(plr)
  5. local info=folder[plr.Name].length.Value
  6. if game.Players.LocalPlayer.Character then
  7. if info>(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p-plr.Character.HumanoidRootPart.Position).magnitude or info<(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p-plr.Character.HumanoidRootPart.Position).magnitude then
  8. local dist=(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p-plr.Character.HumanoidRootPart.Position).magnitude
  9. folder[plr.Name].Size=Vector3.new(0.2,0.2,dist)
  10. folder[plr.Name].CFrame= CFrame.new(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p, plr.Character.HumanoidRootPart.Position)*CFrame.new(0,0,-dist/2)
  11. end
  12. end
  13. end
  14. function deletebeam(plr)
  15. for i,v in pairs(folder:GetChildren()) do
  16. if v.Name==plr.Name then
  17. v:Destroy()
  18. end
  19. end
  20. end
  21. function beam(plr)
  22. deletebeam(plr)
  23. if game.Players.LocalPlayer.Character and plr.Character and game.Players[plr.Name] and plr.Character["HumanoidRootPart"] then
  24. local ray=Ray.new(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p, (plr.Character.HumanoidRootPart.CFrame.p-game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p).unit*300)
  25. local part=plr.Character.HumanoidRootPart
  26. local pos=plr.Character.HumanoidRootPart.Position
  27. local trac=Instance.new("Part",folder)
  28. local length=Instance.new("IntValue",trac)
  29. length.Name="length"
  30. trac.Name=plr.Name
  31. trac.BrickColor=BrickColor.new("White")
  32. coroutine.resume(coroutine.create(function()
  33. while folder:FindFirstChild(plr.Name) do
  34. if plr.Character:FindFirstChildOfClass("Tool") and trac.BrickColor==BrickColor.new("White") then
  35. trac.BrickColor=BrickColor.new("Camo")
  36. game:GetService("RunService").RenderStepped:Wait()
  37. else
  38. break
  39. end
  40. end
  41. end))
  42. coroutine.resume(coroutine.create(function()
  43. while folder:FindFirstChild(plr.Name) do
  44. if #game.Teams:GetChildren()<=1 then
  45. break
  46. else
  47. for i,v in pairs(game.Teams:GetChildren()) do
  48. for x,d in pairs(v:GetPlayers()) do
  49. if d==plr then
  50. trac.BrickColor=v.TeamColor
  51. game:GetService("RunService").RenderStepped:Wait()
  52. end
  53. end
  54. end
  55.  
  56. end
  57. end
  58. end))
  59.  
  60. trac.FormFactor="Custom"
  61. trac.Material="Neon"
  62. trac.Transparency = 0.5
  63. trac.Anchored = true
  64. trac.CanCollide = false
  65. local distance=(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p-pos).magnitude
  66. length.Value=distance
  67. trac.Size=Vector3.new(0.2,0.2,dist)
  68. trac.CFrame= CFrame.new(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p, pos)*CFrame.new(0,0,-distance/2)
  69. coroutine.resume(coroutine.create(function()
  70. while folder:FindFirstChild(plr.Name) do
  71. if game.Players[plr.Name] then
  72. update(plr)
  73. game:GetService("RunService").RenderStepped:Wait()
  74. else
  75. deletebeam(plr)
  76. game:GetService("RunService").RenderStepped:Wait()
  77. end
  78. end
  79. end))
  80. end
  81. end
  82. for i,v in pairs(game:GetService"Players":GetPlayers()) do
  83. if v~=game.Players.LocalPlayer then
  84. beam(v)
  85. v.CharacterAdded:connect(function()
  86. wait(.5)
  87. beam(v)
  88. end)
  89. end
  90. end
  91. game.Players.PlayerAdded:connect(function(plr)
  92. repeat wait() until plr.Character:FindFirstChild("HumanoidRootPart")~=nil
  93. beam(plr)
  94. print(plr.Name.."Added")
  95. end)
  96. game.Players.ChildRemoved:connect(function(part)
  97. if part:IsA("Player") then
  98. deletebeam(part)
  99. end
  100. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement