Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function comment(msg)
  2. warn(msg)
  3. end
  4. wait(2)
  5. lp = game:GetService("Players").turbotwister12
  6. char = lp.Character
  7. tool = Instance.new("Tool",lp.Backpack)
  8. tool.Name = "Pokeball"
  9. handle = Instance.new("Part",tool)
  10. handle.Name = "Handle"
  11. handle.Shape = Enum.PartType.Ball
  12. handle.Size = Vector3.new(1.5,1.5,1.5)
  13. handle.BrickColor = BrickColor.Red()
  14. debounce = false
  15. caught = nil
  16. tool.Activated:connect(function()
  17.     comment("onactivate")
  18.     if debounce == false then
  19.         debounce = true
  20.         comment("debounce")
  21.         if caught == nil then
  22.             comment("caught")
  23.             gc = workspace:GetChildren()
  24.             for i=1, #gc do
  25.                 comment("gc")
  26.                 if gc[i] ~= char and gc[i]:FindFirstChildOfClass("Humanoid") then
  27.                     comment("hum")
  28.                     if gc[i]:FindFirstChild("Head") then
  29. comment("hum")                     
  30.                         if (gc[i]:FindFirstChild("Head").Position - char.Head.Position).magnitude < 15 then
  31.                             handle.Parent = workspace
  32.                             handle.CanCollide = false
  33.                             bp = Instance.new("BodyPosition",handle)
  34.                             bp.MaxForce = Vector3.new(4500,4500,4500)
  35.                             bp.P = 4500
  36.                             bp.Position = gc[i]:FindFirstChild("Head").Position
  37.                             repeat
  38.                                 wait(0.01)
  39.                             until (handle.Position - gc[i]:FindFirstChild("Head").Position).magnitude < 10
  40.                             bp:Destroy()
  41.                             caught = gc[i]
  42.                             gc[i].Parent = nil
  43.                             handle.CanCollide = false
  44.                             handle.Parent = tool
  45.                         end
  46.                     end
  47.                 end
  48.             end
  49.         else
  50.             handle.Parent = workspace
  51.             handle.CanCollide = true
  52.             wait(0.2)
  53.             caught.Parent = workspace
  54.            
  55.             caught.Head.CFrame = handle.CFrame + Vector3.new(0,3.5,0)
  56.             caught = nil
  57.             wait(0.2)
  58.             handle.Parent = tool
  59.             handle.CanCollide = false
  60.         end
  61.         wait(5)
  62.         debounce = false
  63.     end
  64. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement