Advertisement
kyanopro

esp

Feb 13th, 2020
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.65 KB | None | 0 0
  1. print("Made By KMG#0305")
  2.  
  3. local Holder = Instance.new("Folder", game.CoreGui)
  4. Holder.Name = "ESP"
  5.  
  6. local UpdateFuncs = {}
  7.  
  8. local Box = Instance.new("BoxHandleAdornment")
  9. Box.Name = "nilBox"
  10. Box.Size = Vector3.new(3, 6, 3)
  11. Box.Color3 = Color3.new(100 / 255, 100 / 255, 100 / 255)
  12. Box.Transparency = 0.7
  13. Box.ZIndex = 0
  14. Box.AlwaysOnTop = true
  15. Box.Visible = true
  16.  
  17. local NameTag = Instance.new("BillboardGui")
  18. NameTag.Name = "nilNameTag"
  19. NameTag.Enabled = false
  20. NameTag.Size = UDim2.new(0, 200, 0, 50)
  21. NameTag.AlwaysOnTop = true
  22. NameTag.StudsOffset = Vector3.new(0, 1.8, 0)
  23. local Tag = Instance.new("TextLabel", NameTag)
  24. Tag.Name = "Tag"
  25. Tag.BackgroundTransparency = 1
  26. Tag.Position = UDim2.new(0, -50, 0, 0)
  27. Tag.Size = UDim2.new(0, 300, 0, 20)
  28. Tag.TextSize = 20
  29. Tag.TextColor3 = Color3.new(100 / 255, 100 / 255, 100 / 255)
  30. Tag.TextStrokeColor3 = Color3.new(0 / 255, 0 / 255, 0 / 255)
  31. Tag.TextStrokeTransparency = 0.4
  32. Tag.Text = "nil"
  33. Tag.Font = Enum.Font.SourceSansBold
  34. Tag.TextScaled = false
  35.  
  36. local LoadCharacter = function(v)
  37. repeat wait() until v.Character ~= nil
  38. v.Character:WaitForChild("Humanoid")
  39. local vHolder = Holder:FindFirstChild(v.Name)
  40. vHolder:ClearAllChildren()
  41. local b = Box:Clone()
  42. b.Name = v.Name .. "Box"
  43. b.Adornee = v.Character
  44. b.Parent = vHolder
  45. local t = NameTag:Clone()
  46. t.Name = v.Name .. "NameTag"
  47. t.Enabled = false
  48. t.Parent = vHolder
  49. t.Adornee = v.Character:WaitForChild("Head", 5)
  50. if not t.Adornee then
  51. return UnloadCharacter(v)
  52. end
  53. --t.Tag.Text = v.Name
  54. b.Color3 = Color3.new(v.TeamColor.r, v.TeamColor.g, v.TeamColor.b)
  55. t.Tag.TextColor3 = Color3.new(v.TeamColor.r, v.TeamColor.g, v.TeamColor.b)
  56. local UpdateNameTag = function()
  57. if not pcall(function()
  58. --v.Character.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None
  59. local maxh = math.floor(v.Character.Humanoid.MaxHealth)
  60. local h = math.floor(v.Character.Humanoid.Health)
  61. t.Tag.Text = v.Name .. "\n" .. ((maxh ~= 0 and tostring(math.floor((h / maxh) * 100))) or "0") .. "% " .. tostring(h) .. "/" .. tostring(maxh)
  62. end) then
  63. UpdateFuncs[v] = nil
  64. end
  65. end
  66. UpdateNameTag()
  67. UpdateFuncs[v] = UpdateNameTag
  68. end
  69.  
  70. local UnloadCharacter = function(v)
  71. local vHolder = Holder:FindFirstChild(v.Name)
  72. if vHolder and (vHolder:FindFirstChild(v.Name .. "Box") ~= nil or vHolder:FindFirstChild(v.Name .. "NameTag") ~= nil) then
  73. vHolder:ClearAllChildren()
  74. end
  75. end
  76.  
  77. local LoadPlayer = function(v)
  78. local vHolder = Instance.new("Folder", Holder)
  79. vHolder.Name = v.Name
  80. v.CharacterAdded:Connect(function()
  81. pcall(LoadCharacter, v)
  82. end)
  83. v.CharacterRemoving:Connect(function()
  84. pcall(UnloadCharacter, v)
  85. end)
  86. LoadCharacter(v)
  87. end
  88.  
  89. local UnloadPlayer = function(v)
  90. UnloadCharacter(v)
  91. local vHolder = Holder:FindFirstChild(v.Name)
  92. if vHolder then
  93. vHolder:Destroy()
  94. end
  95. end
  96.  
  97. for i,v in pairs(game:GetService("Players"):GetPlayers()) do
  98. spawn(function() pcall(LoadPlayer, v) end)
  99. end
  100.  
  101. game:GetService("Players").PlayerAdded:Connect(function(v)
  102. pcall(LoadPlayer, v)
  103. end)
  104.  
  105. game:GetService("Players").PlayerRemoving:Connect(function(v)
  106. pcall(UnloadPlayer, v)
  107. end)
  108.  
  109. game.ItemChanged:Connect(function(i, v)
  110. if i:IsA("Player") and v == "TeamColor" then
  111. if Holder:FindFirstChild(i.Name) then
  112. UnloadCharacter(i)
  113. wait()
  114. LoadCharacter(i)
  115. end
  116. elseif i:IsA("Humanoid") and i.Parent then
  117. local p = game:GetService("Players"):GetPlayerFromCharacter(i.Parent)
  118. if p and Holder:FindFirstChild(p.Name) then
  119. UpdateFuncs[p]()
  120. end
  121. end
  122. end)
  123.  
  124. game:GetService("Players").LocalPlayer.NameDisplayDistance = 0
  125. game:GetService("Players").LocalPlayer.HealthDisplayDistance = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement