hesiz

Ee

Apr 13th, 2025
17
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.87 KB | None | 0 0
  1. local char = string.char
  2. local function strToName(...) return char(...) end
  3.  
  4. local Players = game:GetService(strToName(80,108,97,121,101,114,115)) -- Players
  5. local RunService = game:GetService(strToName(82,117,110,83,101,114,118,105,99,101)) -- RunService
  6. local StarterGui = game:GetService(strToName(83,116,97,114,116,101,114,71,117,105)) -- StarterGui
  7. local UserInputService = game:GetService(strToName(85,115,101,114,73,110,112,117,116,83,101,114,118,105,99,101)) -- InputService
  8.  
  9. local LocalPlayer = Players.LocalPlayer
  10. local ESPEnabled = true
  11. local LastESPUpdate = 0
  12.  
  13. -- ๐Ÿ›‘ **Improved Notification Function**
  14. local function Notify(title, message, duration)
  15. StarterGui:SetCore(strToName(83,101,110,100,78,111,116,105,102,105,99,97,116,105,111,110), {
  16. Title = title,
  17. Text = message,
  18. Duration = duration or 3
  19. })
  20. end
  21.  
  22. Notify("UESP", "ESP Active. Press ] to toggle, [ to reload.", 5)
  23.  
  24. -- โœ… **Safe Team Color Function**
  25. local function GetPlayerColor(Player)
  26. return (Player.Team and Player.Team.TeamColor.Color) or Color3.fromRGB(255, 255, 255)
  27. end
  28.  
  29. -- ๐Ÿ›  **ESP Creation**
  30. local function CreateESP(Character, Player)
  31. if not Character then return end
  32.  
  33. -- ๐Ÿ“ฆ **Box ESP (Now More Accurate)**
  34. local RootPart = Character:FindFirstChild("HumanoidRootPart") or Character:FindFirstChild("UpperTorso")
  35. if RootPart then
  36. local Box = RootPart:FindFirstChild("BoxESP")
  37. if not Box then
  38. Box = Instance.new("BoxHandleAdornment")
  39. Box.Name = "BoxESP"
  40. Box.Size = Vector3.new(1.3, 2.2, 1.3) -- ๐Ÿ”ง **Smaller for Accuracy**
  41. Box.Adornee = RootPart
  42. Box.AlwaysOnTop = true
  43. Box.ZIndex = 5
  44. Box.Transparency = 0.2
  45. Box.Parent = RootPart
  46. end
  47. Box.Color3 = GetPlayerColor(Player)
  48. Box.Visible = ESPEnabled
  49. end
  50.  
  51. -- ๐Ÿ”ค **Name ESP (Adjusted for Distance)**
  52. local Head = Character:FindFirstChild("Head")
  53. if Head then
  54. local NameTag = Head:FindFirstChild("NameESP")
  55. if not NameTag then
  56. NameTag = Instance.new("BillboardGui")
  57. NameTag.Name = "NameESP"
  58. NameTag.Size = UDim2.new(0, 150, 0, 40)
  59. NameTag.Adornee = Head
  60. NameTag.AlwaysOnTop = true
  61.  
  62. local Label = Instance.new("TextLabel")
  63. Label.Name = "NameLabel"
  64. Label.BackgroundTransparency = 1
  65. Label.Size = UDim2.new(1, 0, 1, 0)
  66. Label.Font = Enum.Font.SourceSansBold
  67. Label.TextStrokeTransparency = 0.5
  68. Label.Parent = NameTag
  69. NameTag.Parent = Head
  70. end
  71.  
  72. -- ๐Ÿ“ **Distance-Based Scaling**
  73. local Distance = 0
  74. local LocalRoot = LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart")
  75. if LocalRoot then
  76. Distance = (LocalRoot.Position - Head.Position).Magnitude
  77. end
  78.  
  79. local Scale = math.clamp(1 - (Distance / 500), 0.5, 1)
  80. local Height = 3 + math.clamp(Distance / 40, 1, 10)
  81.  
  82. NameTag.Size = UDim2.new(0, 150 * Scale, 0, 40 * Scale)
  83. NameTag.StudsOffset = Vector3.new(0, Height, 0)
  84. NameTag.NameLabel.Text = string.format("%s [%d studs]", Player.Name, math.floor(Distance))
  85. NameTag.NameLabel.TextColor3 = GetPlayerColor(Player)
  86. NameTag.NameLabel.TextSize = math.clamp(16 * Scale, 10, 16)
  87. NameTag.Enabled = ESPEnabled
  88. end
  89.  
  90. -- ๐Ÿ”ฅ **Chams ESP (Now Properly Applied)**
  91. local Highlight = Character:FindFirstChild("ChamsESP")
  92. if not Highlight then
  93. Highlight = Instance.new("Highlight")
  94. Highlight.Name = "ChamsESP"
  95. Highlight.Parent = Character
  96. end
  97.  
  98. Highlight.FillColor = GetPlayerColor(Player)
  99. Highlight.OutlineColor = GetPlayerColor(Player)
  100. Highlight.FillTransparency = 0.15 -- ๐Ÿ”ง **More Visible**
  101. Highlight.OutlineTransparency = 0
  102. Highlight.Enabled = ESPEnabled
  103. end
  104.  
  105. -- ๐Ÿ”„ **ESP Update Function (Now More Efficient)**
  106. local function UpdateESP()
  107. if tick() - LastESPUpdate < 0.1 then return end -- โณ **Updates Every 0.1s**
  108. LastESPUpdate = tick()
  109.  
  110. for _, Player in ipairs(Players:GetPlayers()) do
  111. if Player ~= LocalPlayer and Player.Character then
  112. CreateESP(Player.Character, Player)
  113. end
  114. end
  115. end
  116.  
  117. -- ๐ŸŽฎ **Toggle & Reload**
  118. UserInputService.InputBegan:Connect(function(Input, GameProcessed)
  119. if GameProcessed then return end
  120. if Input.KeyCode == Enum.KeyCode.RightBracket then
  121. ESPEnabled = not ESPEnabled
  122. Notify("UESP", ESPEnabled and "Enabled" or "Disabled")
  123. UpdateESP()
  124. elseif Input.KeyCode == Enum.KeyCode.LeftBracket then
  125. Notify("UESP", "ESP Reloaded")
  126. UpdateESP()
  127. end
  128. end)
  129.  
  130. -- ๐ŸŽ **Optimized RunService Connection**
  131. RunService.Heartbeat:Connect(UpdateESP)
Advertisement
Add Comment
Please, Sign In to add comment