KeroroGunso0

SocerBall

Mar 3rd, 2016
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.16 KB | None | 0 0
  1. function prop(part, parent, collide, shap, tran, ref, x, y, z, color, anchor, form)
  2. part.Parent = parent
  3. part.formFactor = form
  4. part.Shape = shap
  5. part.CanCollide = collide
  6. part.Transparency = tran
  7. part.Reflectance = ref
  8. part.Size = Vector3.new(x,y,z)
  9. part.BrickColor = BrickColor.new(color)
  10. part.TopSurface = 0
  11. part.BottomSurface = 0
  12. part.Anchored = anchor
  13. part.Locked = true
  14. part:BreakJoints()
  15. end
  16.  
  17. gui = nil
  18. weld = nil
  19. ball = nil
  20.  
  21. function makegui(player,bul)
  22. if gui ~= nil then
  23. gui:remove()
  24. gui = nil
  25. end
  26. if weld ~= nil then
  27. weld:remove()
  28. weld = nil
  29. end
  30. bul.CanCollide = false
  31. local to = player.Character.Torso
  32. local we = Instance.new("Weld",to)
  33. we.Part0 = we.Parent
  34. we.Part1 = bul
  35. we.C1 = CFrame.new(0,1.5,3.5)
  36. weld = we
  37. local sc = Instance.new("ScreenGui",player.PlayerGui)
  38. sc.Name = "SoccerBall"
  39. local fra = Instance.new("Frame",sc)
  40. fra.Size = UDim2.new(0.15,0,0.2,0)
  41. fra.Position = UDim2.new(0,0,0.25,0)
  42. local kick = Instance.new("TextButton",fra)
  43. kick.Size = UDim2.new(1,0,0.33,0)
  44. kick.Position = UDim2.new(0,0,0,0)
  45. kick.Text = "Kick"
  46. kick.MouseButton1Down:connect(function()
  47. gui:remove()
  48. gui = nil
  49. weld:remove()
  50. weld = nil
  51. bul.CanCollide = true
  52. wait(0.06)
  53. bul.Velocity = to.CFrame.lookVector * 90 + Vector3.new(0,50,0)
  54. end)
  55. local pass = Instance.new("TextButton",fra)
  56. pass.Size = UDim2.new(1,0,0.33,0)
  57. pass.Position = UDim2.new(0,0,0.33,0)
  58. pass.Text = "Pass"
  59. pass.MouseButton1Down:connect(function()
  60. pass:remove()
  61. kick:remove()
  62. local pos = 150
  63. for _,v in pairs(game.Players:GetPlayers()) do
  64. if v.Character ~= nil and v.Name ~= player.Name then
  65. local tor = v.Character:findFirstChild("Torso")
  66. if tor ~= nil then
  67. local button = Instance.new("TextButton",fra)
  68. button.Size = UDim2.new(0,150,0,25)
  69. button.Position = UDim2.new(0,0,0,pos)
  70. button.Text = v.Name
  71. button.MouseButton1Down:connect(function()
  72. to.CFrame = CFrame.new(to.Position, tor.Position)
  73. gui:remove()
  74. gui = nil
  75. weld:remove()
  76. weld = nil
  77. bul.CanCollide = true
  78. wait(0.06)
  79. bul.Velocity = to.CFrame.lookVector * 55 + Vector3.new(0,30,0)
  80. end)
  81. pos = pos + 25
  82. end
  83. end
  84. end
  85. end)
  86. local drop = Instance.new("TextButton",fra)
  87. drop.Size = UDim2.new(1,0,0.33,0)
  88. drop.Position = UDim2.new(0,0,0.66,0)
  89. drop.Text = "Drop"
  90. drop.MouseButton1Down:connect(function()
  91. gui:remove()
  92. gui = nil
  93. weld:remove()
  94. weld = nil
  95. bul.CanCollide = true
  96. end)
  97. gui = sc
  98. end
  99.  
  100. function makeball()
  101. if gui ~= nil then
  102. gui:remove()
  103. gui = nil
  104. end
  105. if weld ~= nil then
  106. weld:remove()
  107. weld = nil
  108. end
  109. ball = nil
  110. bal = Instance.new("Part")
  111. prop(bal,workspace,true,"Ball",0,0,2.6,2.6,2.6,"White",false,"Custom")
  112. bal.CFrame = game.Players.xSoulStealerx.Character.Torso.CFrame * CFrame.new(0,-1,-15)
  113. bal.Friction = 1
  114. ball = bal
  115. ball.Touched:connect(function(hit)
  116. local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
  117. if plr ~= nil then
  118. makegui(plr,ball)
  119. end
  120. end)
  121. ball.Changed:connect(function(prop)
  122. if prop == "Parent" then
  123. if ball.Parent == nil then
  124. makeball()
  125. end
  126. end
  127. end)
  128. end
  129. makeball()
Add Comment
Please, Sign In to add comment