Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. local choice = prompt("Player:","choice",table.unpack(getLoadedPlayers()))
  2. local x,y,z = getPlayerPos(choice)
  3. local x1,y1,z1 = getPlayerPos()
  4. local x = tonumber(x)
  5. if x == nil then
  6. local x = 0
  7. end
  8. local x1 = tonumber(x1)
  9. if x1 == nil then
  10. local x1 = 0
  11. end
  12. local y = tonumber(y)
  13. if y == nil then
  14. local y = 0
  15. end
  16. local y1 = tonumber(y1)
  17. if y1 == nil then
  18. local y1 = 0
  19. end
  20. local z = tonumber(z)
  21. if z == nil then
  22. local z = 0
  23. end
  24. local z1 = tonumber(z1)
  25. if z1 == nil then
  26. local z1 = 0
  27. end
  28. local num = x - x1
  29. local num = num * num
  30. local num2 = y - y1
  31. local num2 = num2 * num2
  32. local num3 = z - z1
  33. local num3 = num3 * num3
  34. local num4 = num + num2 + num3
  35. local num5 = math.sqrt(num4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement