Advertisement
Guest User

Untitled

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