Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. local Type = "Studs" --Can be Studs, CM, Inchs, Meter
  2.  
  3. local function GetValue(OldValue)
  4. if Type == "CM" then
  5. return OldValue / 5
  6. elseif Type == "Inchs" then
  7. return (OldValue / 5) / 2.54
  8. elseif Type == "Meters" then
  9. return OldValue / 20
  10. else
  11. return OldValue / 1
  12. end
  13. end
  14.  
  15. game:GetService("RunService").Heartbeat:Connect(function()
  16. if game.Players.LocalPlayer.Character then
  17. for i,v in pairs(workspace.NPCs:GetChildren()) do
  18. if v.HumanoidRootPart:FindFirstChild("BillboardGui") then
  19. v.HumanoidRootPart.BillboardGui:Destroy()
  20. end
  21. local BillboardGui = Instance.new("BillboardGui")
  22. local TextLabel = Instance.new("TextLabel")
  23. --Properties:
  24. BillboardGui.Parent = v.HumanoidRootPart
  25. BillboardGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  26. BillboardGui.Active = true
  27. BillboardGui.AlwaysOnTop = true
  28. BillboardGui.LightInfluence = 1
  29. BillboardGui.Size = UDim2.new(4.5, 50, 1.29999995, 10)
  30.  
  31. TextLabel.Parent = BillboardGui
  32. TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  33. TextLabel.BackgroundTransparency = 0.30000001192093
  34. TextLabel.Size = UDim2.new(1, 0, 1, 0)
  35. TextLabel.Font = Enum.Font.SourceSans
  36. TextLabel.Text = "x Studs"
  37. TextLabel.TextColor3 = Color3.new(0,0,0)
  38. TextLabel.TextScaled = true
  39. TextLabel.TextSize = 14
  40. TextLabel.TextWrapped = true
  41.  
  42. local Distance = GetValue(math.floor((v.HumanoidRootPart.Position - game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude))
  43. TextLabel.Text = v.Name .. " is " .. tostring(Distance) .. " " .. Type .. " away"
  44. end
  45. end
  46. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement