Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while game.CoreGui:FindFirstChild("Logger") do
- game.CoreGui.Logger:Destroy()
- wait(0.1)
- end
- wait(1)
- local arg = Instance.new("ScreenGui", game.CoreGui)
- arg.Name = "Logger"
- local gr = Instance.new("TextLabel", arg)
- gr.Name = "LogLabel"
- gr.BackgroundTransparency = 0.9
- gr.TextWrapped = true
- gr.TextColor3 = Color3.new(0, 1, 0)
- gr.Active = false
- gr.Text = ""
- gr.Size = UDim2.new(0.5, 0, 1, 0)
- gr.Position = UDim2.new(0.5, 0, 0, 0)
- local function log(m)
- gr.Text = gr.Text .. " " .. m
- end
- local function track(p)
- local bg = Instance.new("BillboardGui", game.CoreGui)
- bg.AlwaysOnTop = true
- bg.Size = UDim2.new(1, 0, 1, 0)
- bg.Adornee = p
- local t = Instance.new("TextLabel", bg)
- t.Size = UDim2.new(1, 0, 1, 0)
- t.Text = "test"
- t.BackgroundTransparency = 1
- t.TextColor3 = Color3.new(1, 0, 0)
- return t
- end
- log("test")
- local cam = workspace.CurrentCamera
- local cache = { }
- local function setup()
- for i, v in next, workspace:GetDescendants() do
- if v.ClassName == "ClickDetector" and v.Parent:IsA("BasePart") then
- local fn = v:GetFullName()
- if not fn:find("Station") then
- table.insert(cache, v.Parent)
- end
- end
- end
- end
- local function view(model, position)
- local viewportFrame = Instance.new("ViewportFrame")
- viewportFrame.AnchorPoint = Vector2.new(.5, .5)
- viewportFrame.Size = UDim2.new(0, 100, 0, 100)
- viewportFrame.Position = UDim2.new(0, vec.x, 0, vec.y)
- viewportFrame.BackgroundTransparency = 1
- model:Clone().Parent = viewportFrame
- local viewportCamera = Instance.new("Camera")
- viewportFrame.CurrentCamera = viewportCamera
- viewportCamera.Parent = viewportFrame
- viewportCamera.CFrame = CFrame.new(position.p - cam.CFrame.lookVector*5, position.p)
- viewportFrame.Parent = game.CoreGui
- return viewportFrame
- end
- local trinkets = { }
- local lastRefresh = tick()
- local function refreshTrinkets(range)
- for i, v in next, trinkets do
- v[2].Parent:Destroy()
- v[3]:Destroy()
- end
- trinkets = { }
- for i, v in next, cache do
- if (v.Parent.Position - game.Players.LocalPlayer.Character.Head.Position).magnitude < range then
- local model = v.Parent
- local position = model:IsA("Model") and model:GetModelCFrame() or model.CFrame
- table.insert(trinkets, {model, track(model), view(model, position), position})
- end
- end
- end
- log("Done")
- local range = 1000
- refreshTrinkets(range)
- local ran = false
- while game.CoreGui:FindFirstChild("Logger") do
- if tick() - lastRefresh > 10 then
- lastRefresh = tick()
- refreshTrinkets(range)
- end
- for i, v in next, trinkets do
- if not v[1].Parent then
- table.remove(trinkets, i)
- else
- local dist = math.floor((v[1].Position-game.Players.LocalPlayer.Character.Head.Position).magnitude)
- v[2].Text = dist
- local spawned = v.Transparency < 1
- for i, v in next, v:GetDescendants() do
- if v:IsA("BasePart") then
- if v.Transparency < 1 then
- spawned = true
- end
- end
- end
- v[2].TextColor3 = spawned and Color3.new(0, 0, 1) or Color3.new(1, 0, 0)
- local vec, on = cam:WorldToScreenPoint(v[4].p)
- if on then
- v[3].Position = UDim2.new(0, vec.x, 0, vec.y)
- if not v[3].Visible then
- v[3].Visible = true
- end
- elseif v[3].Visible then
- v[3].Visible = false
- end
- end
- end
- if not ran then
- ran = true
- log("working")
- end
- wait(1)
- end
- for i, v in next, trinkets do
- v[2].Parent:Destroy()
- v[3]:Destroy()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement