Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function WTS(part)
- local screen = workspace.CurrentCamera:WorldToViewportPoint(part.Position)
- return Vector2.new(screen.x, screen.y)
- end
- function ESPText(part, text, color)
- local name = Drawing.new("Text")
- name.Text = text
- name.Color = color
- name.Position = WTS(part)
- name.Size = 18
- name.Outline = true
- name.Center = true
- name.Visible = true
- game:GetService("RunService").Stepped:connect(function()
- pcall(function()
- local destroyed = not part:IsDescendantOf(workspace)
- if destroyed and name ~= nil then
- name:Remove()
- end
- if part ~= nil then
- name.Position = WTS(part)
- end
- local _, screen = workspace.CurrentCamera:WorldToViewportPoint(part.Position)
- if screen then
- name.Visible = true
- else
- name.Visible = false
- end
- end)
- end)
- end
- -- Actual ESP
- for _,v in next,game.Workspace:GetDescendants() do
- if v.Name == "ChestTop" then
- if v.Parent.Union.BrickColor.Name == "Dirt brown" then
- ESPText(v, "Small Chest", Color3.new(205/255,127/255,50/255))
- elseif v.Parent.Union.BrickColor.Name == "Dark stone grey" then
- ESPText(v, "Medium Chest", Color3.new(192/255,192/255,192/255))
- elseif v.Parent.Union.BrickColor.Name == "Bright yellow" then
- ESPText(v, "Large Chest", Color3.new(255/255,215/255,1/255))
- end
- end
- end
- game.Workspace.DescendantAdded:Connect(function(v)
- if v.Name == "ChestTop" then
- if v.Parent.Union.BrickColor.Name == "Dirt brown" then
- ESPText(v, "Small Chest", Color3.new(205/255,127/255,50/255))
- elseif v.Parent.Union.BrickColor.Name == "Dark stone grey" then
- ESPText(v, "Medium Chest", Color3.new(192/255,192/255,192/255))
- elseif v.Parent.Union.BrickColor.Name == "Bright yellow" then
- ESPText(v, "Large Chest", Color3.new(255/255,215/255,1/255))
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement