Advertisement
LeviTheOtaku

ESP

Feb 9th, 2019
1,172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.58 KB | None | 0 0
  1. --https://v3rmillion.net/showthread.php?tid=776877
  2. local new_user = false
  3.  
  4.  
  5. function CreateESPPart(BodyPart,color)
  6. local ESPPartparent = BodyPart
  7. local Box = Instance.new("BoxHandleAdornment")
  8. Box.Size = BodyPart.Size + Vector3.new(0.1, 0.1, 0.1)
  9. Box.Name = "ESPPart"
  10. Box.Adornee = ESPPartparent
  11. Box.Color3 = color
  12. Box.AlwaysOnTop = true
  13. Box.ZIndex = 5
  14. Box.Transparency = 0.5
  15. Box.Parent = BodyPart
  16. end
  17.  
  18.  
  19. function loadCheck(plr,chr)
  20. if chr:findFirstChild("Humanoid") then
  21. local part = chr:getChildren()
  22. for i=1,#part do
  23. if part[i].ClassName == "Part" or part[i].ClassName == "MeshPart" then
  24. if part[i].Name == "HumanoidRootPart" then
  25. else
  26. wait(0.1)
  27. if part[i]:findFirstChild("ESPPart") then
  28. else
  29. CreateESPPart(part[i],plr.TeamColor.Color)
  30. end
  31.  
  32.  
  33.  
  34. if part[i].Name == "Head" then
  35. if part[i]:findFirstChild("ESPNametag") then
  36. else
  37. local BillboardGui = Instance.new("BillboardGui",part[i])
  38. local TextLabel = Instance.new("TextLabel",BillboardGui)
  39. BillboardGui.Name = "ESPNametag"
  40. BillboardGui.Adornee = part[i]
  41. BillboardGui.ExtentsOffset = Vector3.new(0, 3, 0)
  42. BillboardGui.Size = UDim2.new(0, 200, 0, 50)
  43. BillboardGui.AlwaysOnTop = true
  44. TextLabel.BackgroundTransparency = 1
  45. TextLabel.BorderSizePixel = 0
  46. TextLabel.Size = UDim2.new(1, 0, 1, 0)
  47. TextLabel.Font = Enum.Font.Gotham
  48. TextLabel.FontSize = Enum.FontSize.Size14
  49. TextLabel.TextSize = 10
  50. TextLabel.TextStrokeTransparency = 0
  51. TextLabel.TextColor3 = plr.TeamColor.Color
  52.  
  53.  
  54. if new_user == false then
  55. spawn(function()
  56. while true do
  57. wait(0.1)
  58. local magnitude = (game.Players.LocalPlayer.Character.Head.Position - part[i].Position).magnitude
  59. local dist = 0
  60. if magnitude > 10 then
  61. dist = string.sub(magnitude,1,1)
  62. end
  63. if magnitude > 100 then
  64. dist = string.sub(magnitude,1,2)
  65. end
  66. if magnitude > 1000 then
  67. dist = string.sub(magnitude,1,3)
  68. end
  69. if magnitude > 10000 then
  70. dist = string.sub(magnitude,1,4)
  71. end
  72. if magnitude > 100000 then
  73. dist = string.sub(magnitude,1,5)
  74. end
  75. if magnitude > 1000000 then
  76. dist = string.sub(magnitude,1,6)
  77. end
  78. TextLabel.Text = "\n" .. part[i].Parent.Name .. "\nHealth: " .. part[i].Parent:findFirstChild("Humanoid").Health .. "\nDistance: " .. dist .. "m\n"
  79. end
  80. end)
  81. else
  82. TextLabel.Text = part[i].Parent.Name
  83. end
  84. end
  85. end
  86. end
  87. end
  88. end
  89. end
  90. end
  91.  
  92. local player = game.Players:GetChildren()
  93. for i=1,#player do
  94. if player[i].Name == game.Players.LocalPlayer.Name then
  95. else
  96. player[i]:GetPropertyChangedSignal("Team"):connect(function()
  97. local newcolor = player[i].TeamColor.Color
  98. if player[i].Character:findFirstChild("Head") then
  99. if player[i].Character.Head:findFirstChild("ESPNametag") then
  100. player[i].Character.Head.ESPNametag.TextLabel.TextColor3 = newcolor
  101. end
  102. local part = player[i].Character:getChildren()
  103. for i=1,#part do
  104. if part[i]:findFirstChild("ESPPart") then
  105. part[i].ESPPart.Color3 = newcolor
  106. end
  107. end
  108. end
  109. end)
  110.  
  111. player[i].CharacterAdded:Connect(function(character)
  112. wait(0.5)
  113. loadCheck(player[i],player[i].Character)
  114. end)
  115. loadCheck(player[i],player[i].Character)
  116. end
  117. end
  118.  
  119. game.Players.PlayerAdded:Connect(function(player)
  120.  
  121. player:GetPropertyChangedSignal("Team"):connect(function()
  122. local newcolor = player.TeamColor.Color
  123. if player.Character:findFirstChild("Head") then
  124. if player.Character.Head:findFirstChild("ESPNametag") then
  125. player.Character.Head.ESPNametag.TextLabel.TextColor3 = newcolor
  126. end
  127. local part = player.Character:getChildren()
  128. for i=1,#part do
  129. if part[i]:findFirstChild("ESPPart") then
  130. part[i].ESPPart.Color3 = newcolor
  131. end
  132. end
  133. end
  134.  
  135. end)
  136.  
  137. player.CharacterAdded:Connect(function(character)
  138. wait(0.5)
  139. loadCheck(player,character)
  140. end)
  141. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement