Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.88 KB | None | 0 0
  1. MobEsp = false
  2. MobLocations = {game:GetService("Workspace")} --add locations of the mobs in the workspace
  3. MobNames = {""} --add the names of the mobs
  4.  
  5. PlayerESP = true
  6.  
  7. plr = game.Players.LocalPlayer
  8. _G.on = true --set to false if you want to turn it off
  9.  
  10. names = {}
  11. function isin(obj,tbl)
  12. for a = 1,#tbl do
  13. if obj == tbl[a] then
  14. return true
  15. end
  16. end
  17. return false
  18. end
  19. function test1(D)
  20. local d = tonumber(string.sub(D,1,string.find(D,".",1,true) + 1))
  21. return d
  22. end
  23. function Label(Part,Distance)
  24. local MainName = Part.Parent.Name
  25. local check = Part:FindFirstChild(MainName .. " Tracker")
  26. if check then
  27. destroyed = false
  28. while not destroyed do
  29. for i = 1,#names do
  30. if names[i] == MainName then
  31. table.remove(names,i)
  32. destroyed = true
  33. break
  34. end
  35. end
  36. destroyed = true
  37. end
  38. check:Destroy()
  39. end
  40. local Gui = Instance.new("BillboardGui")
  41. local Text = Instance.new("TextLabel")
  42. if Distance ~= nil then
  43. local assa,D = pcall(test1,Distance)
  44. if D ~= nil and D then
  45. D = tonumber(D)
  46. table.insert(names,MainName)
  47. Gui.Name = MainName.." Tracker"
  48. Gui.Parent = Part
  49. Gui.Adornee = Part
  50. Gui.ExtentsOffsetWorldSpace = Vector3.new(0,3,0)
  51. Gui.MaxDistance = 2500
  52. Gui.Size = UDim2.new(0,200,0,50)
  53. Gui.AlwaysOnTop = true
  54. Text.Parent = Gui
  55. Text.TextWrapped = true
  56. Text.BackgroundTransparency = 1
  57. Text.TextSize = 8
  58. Text.Size = UDim2.new(0, 200, 0, 50)
  59. Text.Font = Enum.Font.Legacy
  60. if D ~= nil and D < 30 then
  61. Text.TextColor3 = Color3.fromRGB(33, 231, 40)
  62. Text.Text = Part.Parent.Name .. "\n Dist: " .. D
  63. elseif D ~= nil and D < 100 then
  64. Text.TextColor3 = Color3.fromRGB(228, 231, 34)
  65. Text.Text = Part.Parent.Name .. "\n Dist: " .. D
  66. elseif D ~= nil and D < 500 then
  67. Text.TextColor3 = Color3.fromRGB(255, 140, 46)
  68. Text.Text = Part.Parent.Name .. "\n Dist: " .. D
  69. elseif D ~= nil and D < 2500 then
  70. Text.TextColor3 = Color3.fromRGB(255, 0, 0)
  71. Text.Text = Part.Parent.Name .. "\n Dist: " .. D
  72. end
  73. end
  74. end
  75. end
  76.  
  77. function Root()
  78. plr = game.Players:FindFirstChild(game.Players.LocalPlayer.Name)
  79. if plr then
  80. local root = plr.Character:FindFirstChild("HumanoidRootPart")
  81. if root then
  82. return root
  83. else
  84. for i = 1,#names do
  85. local check = game.Workspace:FindFirstChild(names[i] .. " Tracker",true)
  86. if check then
  87. table.remove(names,i)
  88. check:Destroy()
  89. break
  90. end
  91. end
  92. game:GetService('RunService').Stepped:wait()
  93. Root()
  94. end
  95. end
  96. end
  97.  
  98. while _G.on do
  99. game:GetService('RunService').Stepped:wait()
  100. plr = game.Players.LocalPlayer
  101. if MobEsp then
  102. for iter = 1,#MobLocations do
  103. local check = MobLocations[iter]:FindFirstChildOfClass("Model")
  104. local check2 = MobLocations[iter]:FindFirstChildOfClass("Part")
  105. if check or check2 then
  106. for i,v in pairs(MobLocations[iter]:GetChildren()) do
  107. if v.ClassName == "Model" or v.ClassName == "Part" and isin(v.Name,MobNames) == true then
  108. local placed = false
  109. for a,b in pairs(v:GetChildren()) do
  110. if b.Name == "Head" and b.ClassName == "Part" and not placed and isin(v.Name,MobNames) == true then
  111. placed = true
  112. Label(b,(Root().Position - b.Position).Magnitude)
  113. elseif b.Name == "UpperTorso" and b.ClassName == "Part" and not placed and isin(v.Name,MobNames) == true then
  114. placed = true
  115. Label(b,(Root().Position - b.Position).Magnitude)
  116. elseif b.Name == "Torso" and b.ClassName == "Part" and not placed and isin(v.Name,MobNames) == true then
  117. placed = true
  118. Label(b,(Root().Position - b.Position).Magnitude)
  119. elseif b.ClassName == "Part" and not placed and isin(v.Name,MobNames) == true then
  120. placed = true
  121. repeat wait() until game.Players.LocalPlayer.Character ~= nil
  122. Label(b,(Root().Position - b.Position).Magnitude)
  123. end
  124. end
  125. end
  126. end
  127. end
  128. end
  129. end
  130. if PlayerESP then
  131. for z,d in pairs(game.Players:GetChildren()) do
  132. if d.Character ~= nil and d ~= plr then
  133. local prt = d.Character:FindFirstChildOfClass("Part")
  134. if prt then
  135. local placed = false
  136. for j,g in pairs(d.Character:GetChildren()) do
  137. if g.Name == "Head" and not placed then
  138. placed = true
  139. Label(g,(Root().Position - g.Position).Magnitude)
  140. elseif g.Name == "UpperTorso" and not placed then
  141. placed = true
  142. Label(g,(Root().Position - g.Position).Magnitude)
  143. elseif g.Name == "Torso" and not placed then
  144. placed = true
  145. Label(g,(Root().Position - g.Position).Magnitude)
  146. end
  147. end
  148. end
  149. end
  150. end
  151. end
  152. end
  153. while #names > 0 do
  154. game:GetService('RunService').Stepped:wait()
  155. for i = 1,#names do
  156. local check = game.Workspace:FindFirstChild(names[i] .. " Tracker",true)
  157. if check then
  158. table.remove(names,i)
  159. check:Destroy()
  160. break
  161. end
  162. end
  163. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement