Advertisement
dkg_yt

Untitled

Oct 26th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. faces = {"Front","Back","Bottom","Left","Right","Top"}
  2. local transparency = .5
  3. players = game:GetService("Players")
  4. faces = {"Front","Back","Bottom","Left","Right","Top"}
  5. currentPlayer = nil
  6. lplayer = players.LocalPlayer
  7.  
  8. --color
  9. ALLYCOLOR = {0,255,255}
  10. ENEMYCOLOR = {255,0,0}
  11. HEALTHBAR_ACTIVATED = true
  12.  
  13. function checkPart(obj) if (obj:IsA("Part") or obj:IsA("MeshPart")) and obj.Name~="HumanoidRootPart" then return true end end
  14.  
  15. function actualESP(obj)
  16.  
  17. for i=0,5 do
  18. local surface = Instance.new("SurfaceGui",obj)
  19. surface.Face = Enum.NormalId[faces[i+1]]
  20. surface.AlwaysOnTop = true
  21.  
  22. local frame = Instance.new("Frame",surface)
  23. frame.Size = UDim2.new(1,0,1,0)
  24. frame.BorderSizePixel = 0
  25. frame.BackgroundTransparency = transparency
  26. if currentPlayer.Team == players.LocalPlayer.Team then
  27. frame.BackgroundColor3 = Color3.new(ALLYCOLOR[1],ALLYCOLOR[2],ALLYCOLOR[3])
  28. else
  29. frame.BackgroundColor3 = Color3.new(ENEMYCOLOR[1],ENEMYCOLOR[2],ENEMYCOLOR[3])
  30. end
  31. end
  32. end
  33.  
  34.  
  35. function createHealthbar(hrp)
  36. local board = Instance.new("BillboardGui",hrp)
  37. board.Name = "total"
  38. board.Size = UDim2.new(1,0,1,0)
  39. board.StudsOffset = Vector3.new(3,1,0)
  40. board.AlwaysOnTop = true
  41.  
  42. local bar = Instance.new("Frame",board)
  43. bar.BackgroundColor3 = Color3.new(255,0,0)
  44. bar.BorderSizePixel = 0
  45. bar.Size = UDim2.new(0.2,0,4,0)
  46. bar.Name = "total2"
  47.  
  48. local health = Instance.new("Frame",bar)
  49. health.BackgroundColor3 = Color3.new(0,255,0)
  50. health.BorderSizePixel = 0
  51. health.Size = UDim2.new(1,0,hrp.Parent.Humanoid.Health/100,0)
  52. hrp.Parent.Humanoid.Changed:Connect(function(property)
  53. hrp.total.total2.Frame.Size = UDim2.new(1,0,hrp.Parent.Humanoid.Health/100,0)
  54. end)
  55. end
  56.  
  57.  
  58. function createESP(c)
  59. local bugfix = c:WaitForChild("Head")
  60. for i,v in pairs(c:GetChildren()) do
  61. if checkPart(v) then
  62. actualESP(v)
  63. end
  64. end
  65. if HEALTHBAR_ACTIVATED then
  66. createHealthbar(c:WaitForChild("HumanoidRootPart"))
  67. end
  68. end
  69.  
  70. for i,people in pairs(players:GetChildren())do
  71. if people ~= players.LocalPlayer then
  72. currentPlayer = people
  73.  
  74. createESP(people.Character)
  75. people.CharacterAdded:Connect(function(character)
  76. createESP(character)
  77. end)
  78. end
  79. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement