RoSploitzer

Name ESP Script

Jun 11th, 2019
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.19 KB | None | 0 0
  1. ESPEnabled = true
  2. ESPLength = 1000000
  3.  
  4. local plr = game:GetService("Players").LocalPlayer
  5. local char = plr.Character
  6. local root = char.HumanoidRootPart
  7. local Plrs = game:GetService("Players")
  8. local MyPlr = Plrs.LocalPlayer
  9. local MyChar = MyPlr.Character
  10. local CoreGui = game:GetService("CoreGui")
  11. local Run = game:GetService("RunService")
  12.  
  13. CharAddedEvent = { }
  14.  
  15. Plrs.PlayerAdded:connect(function(plr)
  16. if CharAddedEvent[plr.Name] == nil then
  17. CharAddedEvent[plr.Name] = plr.CharacterAdded:connect(function(char)
  18. if ESPEnabled then
  19. RemoveESP(plr)
  20. CreateESP(plr)
  21. end
  22. end)
  23. end
  24. end)
  25.  
  26. Plrs.PlayerRemoving:connect(function(plr)
  27. if CharAddedEvent[plr.Name] ~= nil then
  28. CharAddedEvent[plr.Name]:Disconnect()
  29. CharAddedEvent[plr.Name] = nil
  30. end
  31. RemoveESP(plr)
  32. end)
  33.  
  34. function UpdateESP(plr)
  35. local Find = CoreGui:FindFirstChild("ESP_" .. plr.Name)
  36. Find.Frame.Names.TextColor3 = Color3.new(0.8, 0.8, 0)
  37. Find.Frame.Names.TextColor3 = Color3.new(1, 1, 1)
  38. Find.Frame.Dist.TextColor3 = Color3.new(1, 1, 1)
  39. local GetChar = plr.Character
  40. if MyChar and GetChar then
  41. local Find2 = MyChar:FindFirstChild("HumanoidRootPart")
  42. local Find3 = GetChar:FindFirstChild("HumanoidRootPart")
  43. local Find4 = GetChar:FindFirstChildOfClass("Humanoid")
  44. if Find2 and Find3 then
  45. local pos = Find3.Position
  46. local Dist = (Find2.Position - pos).magnitude
  47. if Dist > ESPLength then
  48. Find.Frame.Names.Visible = false
  49. Find.Frame.Dist.Visible = false
  50. return
  51. else
  52. Find.Frame.Names.Visible = true
  53. Find.Frame.Dist.Visible = true
  54. end
  55. Find.Frame.Dist.Text = "Distance: " .. string.format("%.0f", Dist)
  56. end
  57. end
  58. end
  59.  
  60. function RemoveESP(plr)
  61. local ESP = CoreGui:FindFirstChild("ESP_" .. plr.Name)
  62. if ESP then
  63. ESP:Destroy()
  64. end
  65. end
  66.  
  67. function CreateESP(plr)
  68. if plr ~= nil then
  69. local GetChar = plr.Character
  70. if not GetChar then return end
  71. local GetHead do
  72. repeat wait() until GetChar:FindFirstChild("Head")
  73. end
  74. GetHead = GetChar.Head
  75.  
  76. local bb = Instance.new("BillboardGui", CoreGui)
  77. bb.Adornee = GetHead
  78. bb.ExtentsOffset = Vector3.new(0, 1, 0)
  79. bb.AlwaysOnTop = true
  80. bb.Size = UDim2.new(0, 5, 0, 5)
  81. bb.StudsOffset = Vector3.new(0, 3, 0)
  82. bb.Name = "ESP_" .. plr.Name
  83.  
  84. local frame = Instance.new("Frame", bb)
  85. frame.ZIndex = 10
  86. frame.BackgroundTransparency = 1
  87. frame.Size = UDim2.new(1, 0, 1, 0)
  88.  
  89. local TxtName = Instance.new("TextLabel", frame)
  90. TxtName.Name = "Names"
  91. TxtName.ZIndex = 10
  92. TxtName.Text = plr.Name
  93. TxtName.BackgroundTransparency = 1
  94. TxtName.Position = UDim2.new(0, 0, 0, -45)
  95. TxtName.Size = UDim2.new(1, 0, 10, 0)
  96. TxtName.Font = "SourceSansBold"
  97. TxtName.TextColor3 = Color3.new(0, 0, 0)
  98. TxtName.TextSize = 14
  99. TxtName.TextStrokeTransparency = 0.5
  100.  
  101. local TxtDist = Instance.new("TextLabel", frame)
  102. TxtDist.Name = "Dist"
  103. TxtDist.ZIndex = 10
  104. TxtDist.Text = ""
  105. TxtDist.BackgroundTransparency = 1
  106. TxtDist.Position = UDim2.new(0, 0, 0, -35)
  107. TxtDist.Size = UDim2.new(1, 0, 10, 0)
  108. TxtDist.Font = "SourceSansBold"
  109. TxtDist.TextColor3 = Color3.new(0, 0, 0)
  110. TxtDist.TextSize = 15
  111. TxtDist.TextStrokeTransparency = 0.5
  112. end
  113. end
  114.  
  115.  
  116. Run:BindToRenderStep("UpdateESP", Enum.RenderPriority.Character.Value, function()
  117. for _, v in next, Plrs:GetPlayers() do
  118. UpdateESP(v)
  119. end
  120. end)
  121.  
  122. local MainGUI = Instance.new("ScreenGui")
  123. local MainFrame = Instance.new("Frame")
  124. local esptrack = Instance.new("TextButton")
  125. local Close = Instance.new("TextButton")
  126.  
  127. MainGUI.Name = "MainGUI"
  128. MainGUI.Parent = game.CoreGui
  129. MainGUI.ResetOnSpawn = false
  130. local MainCORE = game.CoreGui["MainGUI"]
  131.  
  132. MainFrame.Name = "MainFrame"
  133. MainFrame.Parent = MainGUI
  134. MainFrame.BackgroundColor3 = Color3.new(0, 0, 0)
  135. MainFrame.BackgroundTransparency = 0.5
  136. MainFrame.BorderSizePixel = 0
  137. MainFrame.Active = true
  138. MainFrame.Selectable = true
  139. MainFrame.Draggable = true
  140. MainFrame.Position = UDim2.new(0, 0, 0.270916343, 0)
  141. MainFrame.Size = UDim2.new(0, 67, 0, 20)
  142. MainFrame.Visible = true
  143.  
  144. esptrack.Name = "esptrack"
  145. esptrack.Parent = MainFrame
  146. esptrack.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1)
  147. esptrack.BorderColor3 = Color3.new(0.6, 0.6, 0.6)
  148. esptrack.Position = UDim2.new(0.392578244, 0, -0.00380921364, 0)
  149. esptrack.Size = UDim2.new(0, 40, 0, 20)
  150. esptrack.TextColor3 = Color3.new(1, 1, 1)
  151. esptrack.Font = Enum.Font.Fantasy
  152. esptrack.Text = "ESP"
  153. esptrack.TextSize = 16
  154. esptrack.TextWrapped = true
  155. esptrack.MouseButton1Click:connect(function()
  156. ESPEnabled = not ESPEnabled
  157. if ESPEnabled then
  158. esptrack.BackgroundColor3 = Color3.new(0, 0.5, 0)
  159. for _, v in next, Plrs:GetPlayers() do
  160. if v ~= MyPlr then
  161. if CharAddedEvent[v.Name] == nil then
  162. CharAddedEvent[v.Name] = v.CharacterAdded:connect(function(Char)
  163. if ESPEnabled then
  164. RemoveESP(v)
  165. CreateESP(v)
  166. end
  167. repeat wait() until Char:FindFirstChild("HumanoidRootPart")
  168. end)
  169. end
  170. RemoveESP(v)
  171. CreateESP(v)
  172. end
  173. end
  174. else
  175. esptrack.BackgroundColor3 = Color3.new(0.1, 0.1, 0.1)
  176. for _, v in next, Plrs:GetPlayers() do
  177. RemoveESP(v)
  178. end
  179. end
  180. end)
  181.  
  182. Close.Name = "Close"
  183. Close.Parent = MainFrame
  184. Close.BackgroundColor3 = Color3.new(1, 0, 0)
  185. Close.Position = UDim2.new(-0.00261712074, 0, -0.00380919501, 0)
  186. Close.Size = UDim2.new(0, 27, 0, 20)
  187. Close.Font = Enum.Font.SourceSans
  188. Close.Text = "X"
  189. Close.TextColor3 = Color3.new(0, 0, 0)
  190. Close.TextSize = 20
  191. Close.MouseButton1Down:connect(function()
  192. MainGUI:Destroy()
  193. end)
Add Comment
Please, Sign In to add comment