Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function comment(msg)
- warn(msg)
- end
- wait(2)
- lp = game:GetService("Players").owner
- char = lp.Character
- tool = Instance.new("Tool",lp.Backpack)
- tool.Name = "Pokeball"
- handle = Instance.new("Part",tool)
- handle.Name = "Handle"
- handle.Shape = Enum.PartType.Ball
- handle.Size = Vector3.new(1.5,1.5,1.5)
- handle.BrickColor = BrickColor.Red()
- debounce = false
- caught = nil
- tool.Activated:connect(function()
- comment("onactivate")
- if debounce == false then
- debounce = true
- comment("debounce")
- if caught == nil then
- comment("caught")
- gc = workspace:GetChildren()
- for i=1, #gc do
- comment("gc")
- if gc[i] ~= char and gc[i]:FindFirstChildOfClass("Humanoid") then
- comment("hum")
- if gc[i]:FindFirstChild("Head") then
- comment("hum")
- if (gc[i]:FindFirstChild("Head").Position - char.Head.Position).magnitude < 15 then
- handle.Parent = workspace
- handle.CanCollide = false
- bp = Instance.new("BodyPosition",handle)
- bp.MaxForce = Vector3.new(4500,4500,4500)
- bp.P = 4500
- bp.Position = gc[i]:FindFirstChild("Head").Position
- repeat
- wait(0.01)
- until (handle.Position - gc[i]:FindFirstChild("Head").Position).magnitude < 10
- bp:Destroy()
- caught = gc[i]
- gc[i].Parent = nil
- handle.CanCollide = false
- handle.Parent = tool
- end
- end
- end
- end
- else
- handle.Parent = workspace
- handle.CanCollide = true
- wait(0.2)
- caught.Parent = workspace
- caught.Head.CFrame = handle.CFrame + Vector3.new(0,3.5,0)
- caught = nil
- wait(0.2)
- handle.Parent = tool
- handle.CanCollide = false
- end
- wait(5)
- debounce = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement