Advertisement
CaliberMag

Untitled

Jul 19th, 2022 (edited)
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. local UserInputService = game:GetService("UserInputService")
  2. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  3.  
  4. local LogService = game:GetService("LogService")
  5. local ScriptContext = game:GetService("ScriptContext")
  6.  
  7. local Player = game:GetService("Players").LocalPlayer
  8. local Heartbeat = game:GetService("RunService").Heartbeat
  9.  
  10. local State_Type = true
  11.  
  12. if not Config.Path then
  13. Config.Path = workspace
  14. end
  15.  
  16. local function WTS(Position)
  17. local Screen = workspace.CurrentCamera:WorldToViewportPoint(Position)
  18. return Vector2.new(Screen.X, Screen.Y)
  19. end
  20.  
  21. local function New_Drawing(Type, Color)
  22. local ESP = Drawing.new(Type)
  23. ESP.Color = Color
  24. ESP.Size = 20.0
  25. ESP.Outline = true
  26. ESP.Center = true
  27. ESP.Visible = true
  28.  
  29. return ESP
  30. end
  31.  
  32. local function Render_ESP(Target, ESP)
  33. local Delta_Time = 0
  34.  
  35. local Loop; Loop = Heartbeat:Connect(function()
  36. if math.floor(Player:DistanceFromCharacter(Target.CFrame.p)) <= Config.Range then
  37. if os.clock() - Delta_Time < Config.Refresh_Rate / 1000 then
  38. return
  39. end
  40. else
  41. ESP.Visible = false
  42. return
  43. end
  44.  
  45. if Target ~= nil and Target.Parent == Config.Path then
  46. ESP.Position = (WTS(Target.CFrame.p) or Vector2.new(0, 0))
  47.  
  48. if Player.Character ~= nil then
  49. ESP.Text = tostring("[".. Target.Parent.Name .."] ".. Target.Name ..[[
  50.  
  51. ]]
  52. .. "[" ..math.floor(Player:DistanceFromCharacter(Target.CFrame.p)).. "]")
  53. end
  54.  
  55. local _, Screen = workspace.CurrentCamera:WorldToViewportPoint(Target.CFrame.p)
  56. if Screen then
  57. ESP.Visible = State_Type
  58. else
  59. ESP.Visible = false
  60. end
  61. else
  62. Loop:Disconnect()
  63.  
  64. if ESP ~= nil then
  65. ESP:Remove()
  66. end
  67. end
  68. end)
  69. end
  70.  
  71. local function Verify_Object(Object)
  72. for _, Entry in pairs(Config.Blacklist) do
  73. if string.find(Entry, Object.Name) then
  74. return false
  75. end
  76. end
  77. return true
  78. end
  79.  
  80. for _, Connection in pairs(getconnections(LogService.MessageOut)) do
  81. Connection:Disable()
  82. end
  83.  
  84. for _, Connection in pairs(getconnections(ScriptContext.Error)) do
  85. Connection:Disable()
  86. end
  87.  
  88. local function Object_Found(Object)
  89. if Object:FindFirstChild("ItemDetector") or Object:FindFirstChild("ID") then
  90. if not Verify_Object(Object) then
  91. return
  92. end
  93. Render_ESP(Object, New_Drawing("Text", Object.Color))
  94. end
  95. end
  96.  
  97. for _, Child in pairs(Config.Path:GetChildren()) do
  98. Object_Found(Child)
  99.  
  100. if Config.Path == ReplicatedStorage then
  101. task.wait()
  102. end
  103. end
  104.  
  105. Config.Path.ChildAdded:Connect(function(Child)
  106. repeat task.wait() until Child.Name
  107. Object_Found(Child)
  108. end)
  109.  
  110. UserInputService.InputBegan:Connect(function(Input_Obj, State)
  111. if Input_Obj.KeyCode == Enum.KeyCode.F2 then
  112. State_Type = not State_Type
  113. end
  114. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement