Advertisement
BobMe

ball

Jun 1st, 2019
338
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. function findplayer(playername)
  2. plrlen = string.len(playername)
  3. Current_Players = game.Players:GetChildren()
  4. for i=1,#Current_Players do
  5. plr = Current_Players[i]
  6. if plr.Name:sub(1,plrlen):lower() == playername:lower() then
  7. return Current_Players[i]
  8. end
  9. end
  10. end
  11.  
  12. function round(number)
  13. kek = nil
  14. local strnum = tostring(number)
  15. for i=1,#strnum do
  16. if string.sub(strnum,i,i) == "." then
  17. kek = tonumber(string.sub(strnum,i+1,i+1))
  18. kek2 = tonumber(string.sub(strnum,1,i-1))
  19. end
  20. end
  21. if kek ~= nil then
  22. if kek >= 5 then
  23. kek2 = kek2 + 1
  24. else
  25. kek2 = kek2
  26. end
  27. end
  28. return kek2
  29. end
  30.  
  31. for i,v in pairs(game.Players:GetChildren()) do
  32. v.Chatted:Connect(function(msg)
  33. if msg:sub(1,5):lower() == ";age " then
  34. player_name = findplayer(msg:sub(6))
  35. if workspace:FindFirstChild("Hint") ~= nil then
  36. workspace:FindFirstChild("Hint"):Destroy()
  37. end
  38. g = Instance.new("Hint",workspace)
  39. j = round(player_name.AccountAge/365)
  40. g.Text = tostring(player_name).."'s age is : "..player_name.AccountAge.." | "..j.." years!"
  41. elseif msg:sub(1,6):lower() == ";ball " then
  42. local num;
  43. for i=7,#msg do
  44. if msg:sub(i,i) == " " then
  45. num = i
  46. end
  47. end
  48. player = findplayer(msg:sub(7,num-1))
  49. dia = tonumber(msg:sub(num+1))
  50. local par = Instance.new("Part",workspace)
  51. local wel = Instance.new("Weld",workspace)
  52. par.Shape = "Ball"
  53. par.Material = "Neon"
  54. par.Transparency = 0.5
  55. if player.Character:FindFirstChild("UpperTorso") then
  56. Torso = player.Character:FindFirstChild("UpperTorso")
  57. else
  58. Torso = player.Character:FindFirstChild("Torso")
  59. end
  60. par.CFrame = Torso.CFrame
  61. par.Size = Vector3.new(dia,dia,dia)
  62. wel.Part0 = Torso
  63. wel.Part1 = par
  64. end
  65. end)
  66. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement