Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Type = "Studs" --Can be Studs, CM, Inchs, Meter
- local function GetValue(OldValue)
- if Type == "CM" then
- return OldValue / 5
- elseif Type == "Inchs" then
- return (OldValue / 5) / 2.54
- elseif Type == "Meters" then
- return OldValue / 20
- else
- return OldValue / 1
- end
- end
- game:GetService("RunService").Heartbeat:Connect(function()
- if game.Players.LocalPlayer.Character then
- for i,v in pairs(workspace.NPCs:GetChildren()) do
- if v.HumanoidRootPart:FindFirstChild("BillboardGui") then
- v.HumanoidRootPart.BillboardGui:Destroy()
- end
- local BillboardGui = Instance.new("BillboardGui")
- local TextLabel = Instance.new("TextLabel")
- --Properties:
- BillboardGui.Parent = v.HumanoidRootPart
- BillboardGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- BillboardGui.Active = true
- BillboardGui.AlwaysOnTop = true
- BillboardGui.LightInfluence = 1
- BillboardGui.Size = UDim2.new(4.5, 50, 1.29999995, 10)
- TextLabel.Parent = BillboardGui
- TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel.BackgroundTransparency = 0.30000001192093
- TextLabel.Size = UDim2.new(1, 0, 1, 0)
- TextLabel.Font = Enum.Font.SourceSans
- TextLabel.Text = "x Studs"
- TextLabel.TextColor3 = Color3.new(0,0,0)
- TextLabel.TextScaled = true
- TextLabel.TextSize = 14
- TextLabel.TextWrapped = true
- local Distance = GetValue(math.floor((v.HumanoidRootPart.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude))
- TextLabel.Text = v.Name .. " is " .. tostring(Distance) .. " " .. Type .. " away"
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement