local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local Camera = workspace.CurrentCamera
local TargetFolder = workspace:WaitForChild("ActiveTornadoes")
local localPlayer = Players.LocalPlayer
local ESP_Table = {}
local function CreateESP(model)
if ESP_Table[model] then return end
local text = Drawing.new("Text")
text.Visible = false
text.Center = true
text.Outline = true
text.Font = 2
text.Size = 22
text.Color = Color3.fromRGB(255, 255, 255)
ESP_Table[model] = text
end
local function RemoveESP(model)
if ESP_Table[model] then
ESP_Table[model]:Remove()
ESP_Table[model] = nil
end
end
RunService.RenderStepped:Connect(function()
for model, drawing in pairs(ESP_Table) do
if model and model.Parent == TargetFolder then
local modelPivot = model:GetPivot()
local pos, onScreen = Camera:WorldToViewportPoint(modelPivot.Position)
if onScreen then
local cleanName = string.sub(model.Name, 1, 3)
local distance = 0
if localPlayer.Character and localPlayer.Character:FindFirstChild("HumanoidRootPart") then
distance = (modelPivot.Position - localPlayer.Character.HumanoidRootPart.Position).Magnitude
end
drawing.Text = string.format("%s | %d Studs", cleanName, math.floor(distance))
drawing.Position = Vector2.new(pos.X, pos.Y - 30)
drawing.Visible = true
else
drawing.Visible = false
end
else
RemoveESP(model)
end
end
end)
TargetFolder.ChildAdded:Connect(function(child)
task.wait(0.5)
if child:IsA("Model") then
CreateESP(child)
end
end)
TargetFolder.ChildRemoved:Connect(function(child)
RemoveESP(child)
end)
task.spawn(function()
while true do
for _, v in pairs(TargetFolder:GetChildren()) do
if v:IsA("Model") and not ESP_Table[v] then
CreateESP(v)
end
end
task.wait(2)
end
end)
for _, v in pairs(TargetFolder:GetChildren()) do
if v:IsA("Model") then
CreateESP(v)
end
end
Comments
No comments yet
Be the first to share your thoughts!