Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.45 KB | None | 0 0
  1. local suffixes = {
  2.     "K",
  3.     "M",
  4.     "B",
  5.     "T",
  6.     "Qa",
  7.     "Qi",
  8.     "Sx",
  9.     "Sp",
  10.     "Oc",
  11.     "No",
  12.     "Dc",
  13.     "Ud",
  14.     "Dd",
  15.     "Td",
  16.     "Qad"
  17. }
  18. function AddComas(n)
  19.     local var
  20.     for i = #suffixes, 1, -1 do
  21.         local v = math.pow(10, i * 3)
  22.         if n >= v then
  23.             local var = ("%.3f"):format(n / v) .. suffixes[i]
  24.             local num = tostring(string.match(var, "%d+"))
  25.             local suffix = string.find(var, "%a+")
  26.             local digit = #num
  27.             if digit == 1 then
  28.                 return ("%.3f"):format(n / v) .. suffixes[i]
  29.             elseif digit == 2 then
  30.                 return ("%.2f"):format(n / v) .. suffixes[i]
  31.             elseif digit == 3 then
  32.                 return ("%.1f"):format(n / v) .. suffixes[i]
  33.             end
  34.         end
  35.     end
  36. end
  37.  
  38. local old = tick()
  39. local total = tick()
  40. local begin = game:GetService("Players").LocalPlayer.PrivateStats.BodyToughness.Value
  41.  
  42.  
  43. game:GetService("Players").LocalPlayer.PrivateStats.BodyToughness.Changed:connect(function(val)
  44.     print(AddComas(val))
  45.     print('time:'..tostring(tick()-old))
  46.     print('total gained:'..tostring(AddComas(val-begin)))
  47.     print('total time:'..tostring(tick()-total))
  48.     old=tick()
  49. end)
  50.  
  51.  
  52.  
  53. local event = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
  54.  
  55. local get = setmetatable({},{
  56.     __index = function(t,k)
  57.         local str = string.lower(tostring(k));
  58.  
  59.         if str == "lplr" then
  60.             return game:GetService("Players").LocalPlayer or nil;
  61.         elseif str == "char" then
  62.             return game:GetService("Players").LocalPlayer.Character or nil;
  63.         else
  64.             return game:GetService(tostring(k));
  65.         end;
  66.     end;
  67. });
  68.  
  69. spawn(function()
  70.     while wait(2) do
  71.         if get.char and get.char:FindFirstChild('Humanoid') then
  72.             local hp = game:GetService("Players").LocalPlayer.Character:FindFirstChild('Humanoid').Health or 0
  73.             local maxhp = game:GetService("Players").LocalPlayer.Character:FindFirstChild('Humanoid').MaxHealth or 100
  74.             if hp ~= maxhp then
  75.                 event:FireServer({"Respawn"})
  76.             end
  77.         end
  78.          if not get.char then
  79.             event:FireServer({"Respawn"})
  80.         end
  81.     end
  82. end)
  83.  
  84. while wait() do
  85.     if get.char and get.char:FindFirstChild('Humanoid') then
  86.         get.char.HumanoidRootPart.CFrame = CFrame.new(-276, 281, 992)
  87.     end
  88. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement