How would I go about making a basketball dribbling stsyem

Hello, as the title suggests- I have tried tweeting the ball I have tried editing the grip position and nothing is working. Please tell me if there are any other ways

First of all, make your ball’s CanCollide property to true. Now, all you can do is play with the Velocity property of the ball like this

local player = game.Players.LocalPlayer

local ball = whatever
local ground = whatever --make sure it's the ground players would play

function dribble()
local distance = player.Character.HumanoidRootPart.Position.Y - ground.Position.Y
ball.Velocity = Vector3.new(0,distance,0)
wait(1)
ball.Velocity = Vector3.new(0, -distance, 0)
--weld it in the player's hand.
end