Advertisement
iiFlamez

Untitled

Mar 18th, 2020
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. function WTS(part)
  2. local screen = workspace.CurrentCamera:WorldToViewportPoint(part.Position)
  3. return Vector2.new(screen.x, screen.y)
  4. end
  5.  
  6. function ESPText(part, text, color)
  7. local name = Drawing.new("Text")
  8. name.Text = text
  9. name.Color = color
  10. name.Position = WTS(part)
  11. name.Size = 18
  12. name.Outline = true
  13. name.Center = true
  14. name.Visible = true
  15.  
  16. game:GetService("RunService").Stepped:connect(function()
  17. pcall(function()
  18. local destroyed = not part:IsDescendantOf(workspace)
  19. if destroyed and name ~= nil then
  20. name:Remove()
  21. end
  22. if part ~= nil then
  23. name.Position = WTS(part)
  24. end
  25. local _, screen = workspace.CurrentCamera:WorldToViewportPoint(part.Position)
  26. if screen then
  27. name.Visible = true
  28. else
  29. name.Visible = false
  30. end
  31. end)
  32. end)
  33. end
  34.  
  35. -- Actual ESP
  36.  
  37. for _,v in next,game.Workspace:GetDescendants() do
  38. if v.Name == "ChestTop" then
  39. if v.Parent.Union.BrickColor.Name == "Dirt brown" then
  40. ESPText(v, "Small Chest", Color3.new(205/255,127/255,50/255))
  41. elseif v.Parent.Union.BrickColor.Name == "Dark stone grey" then
  42. ESPText(v, "Medium Chest", Color3.new(192/255,192/255,192/255))
  43. elseif v.Parent.Union.BrickColor.Name == "Bright yellow" then
  44. ESPText(v, "Large Chest", Color3.new(255/255,215/255,1/255))
  45. end
  46. end
  47. end
  48.  
  49.  
  50. game.Workspace.DescendantAdded:Connect(function(v)
  51. if v.Name == "ChestTop" then
  52. if v.Parent.Union.BrickColor.Name == "Dirt brown" then
  53. ESPText(v, "Small Chest", Color3.new(205/255,127/255,50/255))
  54. elseif v.Parent.Union.BrickColor.Name == "Dark stone grey" then
  55. ESPText(v, "Medium Chest", Color3.new(192/255,192/255,192/255))
  56. elseif v.Parent.Union.BrickColor.Name == "Bright yellow" then
  57. ESPText(v, "Large Chest", Color3.new(255/255,215/255,1/255))
  58. end
  59. end
  60. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement