Advertisement
JackPackS

ESP

Jul 8th, 2021 (edited)
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.06 KB | None | 0 0
  1. local lplr = game.Players.LocalPlayer
  2. local camera = game:GetService("Workspace").CurrentCamera
  3. local CurrentCamera = workspace.CurrentCamera
  4. local worldToViewportPoint = CurrentCamera.worldToViewportPoint
  5.  
  6. local HeadOff = Vector3.new(0, 0.5, 0)
  7. local LegOff = Vector3.new(0,3,0)
  8.  
  9. for i,v in pairs(game.Players:GetChildren()) do
  10. local BoxOutline = Drawing.new("Square")
  11. BoxOutline.Visible = false
  12. BoxOutline.Color = Color3.new(0,0,0)
  13. BoxOutline.Thickness = 3
  14. BoxOutline.Transparency = 1
  15. BoxOutline.Filled = false
  16.  
  17. local Box = Drawing.new("Square")
  18. Box.Visible = false
  19. Box.Color = Color3.new(1,1,1)
  20. Box.Thickness = 1
  21. Box.Transparency = 1
  22. Box.Filled = false
  23.  
  24. function boxesp()
  25. game:GetService("RunService").RenderStepped:Connect(function()
  26. if v.Character ~= nil and v.Character:FindFirstChild("Humanoid") ~= nil and v.Character:FindFirstChild("HumanoidRootPart") ~= nil and v ~= lplr and v.Character.Humanoid.Health > 0 then
  27. local Vector, onScreen = camera:worldToViewportPoint(v.Character.HumanoidRootPart.Position)
  28.  
  29. local RootPart = v.Character.HumanoidRootPart
  30. local Head = v.Character.Head
  31. local RootPosition, RootVis = worldToViewportPoint(CurrentCamera, RootPart.Position)
  32. local HeadPosition = worldToViewportPoint(CurrentCamera, Head.Position + HeadOff)
  33. local LegPosition = worldToViewportPoint(CurrentCamera, RootPart.Position - LegOff)
  34.  
  35. if onScreen then
  36. BoxOutline.Size = Vector2.new(1000 / RootPosition.Z, HeadPosition.Y - LegPosition.Y)
  37. BoxOutline.Position = Vector2.new(RootPosition.X - BoxOutline.Size.X / 2, RootPosition.Y - BoxOutline.Size.Y / 2)
  38. BoxOutline.Visible = true
  39.  
  40. Box.Size = Vector2.new(1000 / RootPosition.Z, HeadPosition.Y - LegPosition.Y)
  41. Box.Position = Vector2.new(RootPosition.X - Box.Size.X / 2, RootPosition.Y - Box.Size.Y / 2)
  42. Box.Visible = true
  43.  
  44. if v.TeamColor == lplr.TeamColor then
  45. BoxOutline.Visible = false
  46. Box.Visible = false
  47. else
  48. BoxOutline.Visible = true
  49. Box.Visible = true
  50. end
  51.  
  52. else
  53. BoxOutline.Visible = false
  54. Box.Visible = false
  55. end
  56. else
  57. BoxOutline.Visible = false
  58. Box.Visible = false
  59. end
  60. end)
  61. end
  62. coroutine.wrap(boxesp)()
  63. end
  64.  
  65. game.Players.PlayerAdded:Connect(function(v)
  66. local BoxOutline = Drawing.new("Square")
  67. BoxOutline.Visible = false
  68. BoxOutline.Color = Color3.new(0,0,0)
  69. BoxOutline.Thickness = 3
  70. BoxOutline.Transparency = 1
  71. BoxOutline.Filled = false
  72.  
  73. local Box = Drawing.new("Square")
  74. Box.Visible = false
  75. Box.Color = Color3.new(1,1,1)
  76. Box.Thickness = 1
  77. Box.Transparency = 1
  78. Box.Filled = false
  79.  
  80. function boxesp()
  81. game:GetService("RunService").RenderStepped:Connect(function()
  82. if v.Character ~= nil and v.Character:FindFirstChild("Humanoid") ~= nil and v.Character:FindFirstChild("HumanoidRootPart") ~= nil and v ~= lplr and v.Character.Humanoid.Health > 0 then
  83. local Vector, onScreen = camera:worldToViewportPoint(v.Character.HumanoidRootPart.Position)
  84.  
  85. local RootPart = v.Character.HumanoidRootPart
  86. local Head = v.Character.Head
  87. local RootPosition, RootVis = worldToViewportPoint(CurrentCamera, RootPart.Position)
  88. local HeadPosition = worldToViewportPoint(CurrentCamera, Head.Position + HeadOff)
  89. local LegPosition = worldToViewportPoint(CurrentCamera, RootPart.Position - LegOff)
  90.  
  91. if onScreen then
  92. BoxOutline.Size = Vector2.new(1000 / RootPosition.Z, HeadPosition.Y - LegPosition.Y)
  93. BoxOutline.Position = Vector2.new(RootPosition.X - BoxOutline.Size.X / 2, RootPosition.Y - BoxOutline.Size.Y / 2)
  94. BoxOutline.Visible = true
  95.  
  96. Box.Size = Vector2.new(1000 / RootPosition.Z, HeadPosition.Y - LegPosition.Y)
  97. Box.Position = Vector2.new(RootPosition.X - Box.Size.X / 2, RootPosition.Y - Box.Size.Y / 2)
  98. Box.Visible = true
  99.  
  100. if v.TeamColor == lplr.TeamColor then
  101. BoxOutline.Visible = false
  102. Box.Visible = false
  103. else
  104. BoxOutline.Visible = true
  105. Box.Visible = true
  106. end
  107.  
  108. else
  109. BoxOutline.Visible = false
  110. Box.Visible = false
  111. end
  112. else
  113. BoxOutline.Visible = false
  114. Box.Visible = false
  115. end
  116. end)
  117. end
  118. coroutine.wrap(boxesp)()
  119. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement