Advertisement
skinkillaz

the streets esp

Aug 19th, 2018
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. _G.speed = 2
  2.  
  3. local plrs = game:GetService("Players")
  4. local wrk = game:GetService("Workspace")
  5. local lp = plrs.LocalPlayer
  6. local camera = wrk.CurrentCamera
  7. local debounce = 0
  8.  
  9. local chams = Instance.new("Folder")
  10. chams.Name = "Chams"
  11. chams.Parent = game:GetService("CoreGui")
  12.  
  13. function checkWalls(limb, plr)
  14. if plrs:FindFirstChild(plr.Name) then
  15.  
  16. if plr.Character and plr.Character.HumanoidRootPart and lp.Character and lp.Character.HumanoidRootPart then
  17. local hit = workspace:FindPartOnRayWithIgnoreList(Ray.new(lp.Character.HumanoidRootPart.CFrame.p, (limb.CFrame.p-lp.Character.HumanoidRootPart.CFrame.p).unit*500), {camera, lp.Character, chams}, false, true)
  18.  
  19. if hit:IsDescendantOf(plr.Character) then
  20. return true
  21. end
  22.  
  23. return false
  24. end
  25.  
  26. end
  27. end
  28.  
  29. function setColor(v, limb)
  30. if v.TeamColor == lp.TeamColor and checkWalls(limb, v) then --Friendly and Visible(Green)
  31. return Color3.fromRGB(0, 255, 0)
  32. elseif v.TeamColor == lp.TeamColor and not checkWalls(limb, v) then --Friendly and Not Visible(Yellow)
  33. return Color3.fromRGB(255, 255, 0)
  34. elseif v.TeamColor ~= lp.TeamColor and checkWalls(limb, v) then --Enemy and Visible(Red)
  35. return Color3.fromRGB(255, 0, 0)
  36. elseif v.TeamColor ~= lp.TeamColor and not checkWalls(limb,v) then --Enemy and Not Visible(Orange)
  37. return Color3.fromRGB(255, 170, 0)
  38. end
  39. end
  40.  
  41. function createCham(limb, plr, fold)
  42. local cham = Instance.new("BoxHandleAdornment")
  43. cham.Name = "Cham"
  44. cham.Color3 = setColor(plr, limb)
  45. cham.Adornee = limb
  46. cham.Size = limb.Size+Vector3.new(0.01, 0.01, 0.01)
  47. cham.AlwaysOnTop = true
  48. cham.ZIndex = 1
  49. cham.Parent = fold
  50. end
  51.  
  52. function newCham(v)
  53. if chams:FindFirstChild(v.Name) then
  54. chams[v.Name]:Destroy()
  55. end
  56.  
  57. local char = Instance.new("Folder")
  58. char.Name = v.Name
  59. char.Parent = chams
  60.  
  61. if v.Character then
  62.  
  63. for _,c in pairs(v.Character:GetChildren()) do
  64. if c:IsA("BasePart") then
  65. createCham(c, v, char)
  66. end
  67. end
  68.  
  69. end
  70. end
  71.  
  72. plrs.PlayerRemoving:connect(function(plr)
  73. if chams:FindFirstChild(plr.Name) then
  74. chams[plr.Name]:Destroy()
  75. end
  76. end)
  77.  
  78. plrs.PlayerAdded:connect(function(v)
  79. spawn(function()
  80. repeat wait() until v.Character
  81.  
  82. if v.Character then
  83. newCham(v)
  84. end
  85.  
  86. v.CharacterAdded:connect(function(char)
  87. repeat wait() until char.HumanoidRootPart
  88. newCham(v)
  89. end)
  90. end)
  91. end)
  92.  
  93. for _,v in pairs(plrs:GetChildren()) do
  94. if v ~= lp then
  95. spawn(function()
  96. repeat wait() until v.Character
  97.  
  98. if v.Character then
  99. newCham(v)
  100. end
  101.  
  102. v.CharacterAdded:connect(function(char)
  103. repeat wait() until char.HumanoidRootPart
  104. newCham(v)
  105. end)
  106. end)
  107.  
  108. end
  109. end
  110.  
  111. game:GetService("RunService").RenderStepped:connect(function()
  112. if debounce%_G.speed == 0 then
  113.  
  114. for _,v in pairs(chams:GetChildren()) do
  115. for _,c in pairs(v:GetChildren()) do
  116. c.Color3 = setColor(plrs[v.Name], c.Adornee)
  117. end
  118. end
  119.  
  120. end
  121.  
  122. debounce = debounce+1
  123. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement