-- ESP setas para Models dentro de Workspace.Resources
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local LP = Players.LocalPlayer
local Resources = Workspace:WaitForChild("Resources")
local trackedItems = {
Gold = {label="<G", color=Color3.fromRGB(255, 215, 0)},
GoldenFood = {label="<F", color=Color3.fromRGB(0, 255, 0)},
GoldenRock = {label="<R", color=Color3.fromRGB(180, 180, 180)},
GoldenWood = {label="<W", color=Color3.fromRGB(139, 69, 19)},
Treasure = {label="<T", color=Color3.fromRGB(255, 200, 0)},
}
-- Criar ScreenGui
local gui = Instance.new("ScreenGui")
gui.Name = "TopDownESP"
gui.ResetOnSpawn = false
gui.Parent = LP:WaitForChild("PlayerGui")
-- Criar setas
local arrows, targets = {}, {}
local i = 0
for name, data in pairs(trackedItems) do
local arrow = Instance.new("TextLabel")
arrow.Name = "Arrow_"..name
arrow.Size = UDim2.new(0, 60, 0, 35)
arrow.Position = UDim2.new(0.5, -120 + (i * 65), 0, 40)
arrow.BackgroundTransparency = 1
arrow.Text = data.label
arrow.TextScaled = true
arrow.TextColor3 = data.color
arrow.Font = Enum.Font.SourceSansBold
arrow.Visible = true
arrow.Parent = gui
arrows[name] = {ui = arrow, baseColor = data.color}
targets[name] = nil
i += 1
end
-- Função para achar Model mais próximo dentro de Resources
local function FindClosestModel(modelName)
local char = LP.Character
if not char then return nil end
local hrp = char:FindFirstChild("HumanoidRootPart")
if not hrp then return nil end
local best, bestDist = nil, math.huge
for _, obj in pairs(Resources:GetChildren()) do
if obj:IsA("Model") and obj.Name == modelName then
local pos = obj:GetPivot().Position
local dist = (hrp.Position - pos).Magnitude
if dist < bestDist then
best = obj
bestDist = dist
end
end
end
return best
end
-- Atualizar alvos (1 vez por segundo)
task.spawn(function()
while task.wait(2) do
for name in pairs(trackedItems) do
targets[name] = FindClosestModel(name)
end
end
end)
-- Atualizar rotação em tempo real
RunService.RenderStepped:Connect(function()
local char = LP.Character
if not char then return end
local hrp = char:FindFirstChild("HumanoidRootPart")
if not hrp then return end
for name, info in pairs(arrows) do
local arrow = info.ui
local target = targets[name]
if target and target.Parent == Resources then
local pos = target:GetPivot().Position
local dir = (pos - hrp.Position)
if dir.Magnitude > 1 then
local angle = -math.deg(math.atan2(dir.X, dir.Z)) + 180
arrow.Rotation = angle
end
arrow.TextColor3 = info.baseColor
else
arrow.Rotation = 0
arrow.TextColor3 = Color3.fromRGB(120, 120, 120)
end
end
end)No comments yet. Be the first to comment!
1-- ESP setas para Models dentro de Workspace.Resources
2local Players = game:GetService("Players")
3local RunService = game:GetService("RunService")
4local Workspace = game:GetService("Workspace")
5local LP = Players.LocalPlayer
6
7local Resources = Workspace:WaitForChild("Resources")
8
9local trackedItems = {
10 Gold = {label="<G", color=Color3.fromRGB(255, 215, 0)},
11 GoldenFood = {label="<F", color=Color3.fromRGB(0, 255, 0)},
12 GoldenRock = {label="<R", color=Color3.fromRGB(180, 180, 180)},
13 GoldenWood = {label="<W", color=Color3.fromRGB(139, 69, 19)},
14 Treasure = {label="<T", color=Color3.fromRGB(255, 200, 0)},
15}
16
17-- Criar ScreenGui
18local gui = Instance.new("ScreenGui")
19gui.Name = "TopDownESP"
20gui.ResetOnSpawn = false
21gui.Parent = LP:WaitForChild("PlayerGui")
22
23-- Criar setas
24local arrows, targets = {}, {}
25local i = 0
26for name, data in pairs(trackedItems) do
27 local arrow = Instance.new("TextLabel")
28 arrow.Name = "Arrow_"..name
29 arrow.Size = UDim2.new(0, 60, 0, 35)
30 arrow.Position = UDim2.new(0.5, -120 + (i * 65), 0, 40)
31 arrow.BackgroundTransparency = 1
32 arrow.Text = data.label
33 arrow.TextScaled = true
34 arrow.TextColor3 = data.color
35 arrow.Font = Enum.Font.SourceSansBold
36 arrow.Visible = true
37 arrow.Parent = gui
38 arrows[name] = {ui = arrow, baseColor = data.color}
39 targets[name] = nil
40 i += 1
41end
42
43-- Função para achar Model mais próximo dentro de Resources
44local function FindClosestModel(modelName)
45 local char = LP.Character
46 if not char then return nil end
47 local hrp = char:FindFirstChild("HumanoidRootPart")
48 if not hrp then return nil end
49
50 local best, bestDist = nil, math.huge
51 for _, obj in pairs(Resources:GetChildren()) do
52 if obj:IsA("Model") and obj.Name == modelName then
53 local pos = obj:GetPivot().Position
54 local dist = (hrp.Position - pos).Magnitude
55 if dist < bestDist then
56 best = obj
57 bestDist = dist
58 end
59 end
60 end
61 return best
62end
63
64-- Atualizar alvos (1 vez por segundo)
65task.spawn(function()
66 while task.wait(2) do
67 for name in pairs(trackedItems) do
68 targets[name] = FindClosestModel(name)
69 end
70 end
71end)
72
73-- Atualizar rotação em tempo real
74RunService.RenderStepped:Connect(function()
75 local char = LP.Character
76 if not char then return end
77 local hrp = char:FindFirstChild("HumanoidRootPart")
78 if not hrp then return end
79
80 for name, info in pairs(arrows) do
81 local arrow = info.ui
82 local target = targets[name]
83
84 if target and target.Parent == Resources then
85 local pos = target:GetPivot().Position
86 local dir = (pos - hrp.Position)
87 if dir.Magnitude > 1 then
88 local angle = -math.deg(math.atan2(dir.X, dir.Z)) + 180
89 arrow.Rotation = angle
90 end
91 arrow.TextColor3 = info.baseColor
92 else
93 arrow.Rotation = 0
94 arrow.TextColor3 = Color3.fromRGB(120, 120, 120)
95 end
96 end
97end)