How to make a basketball dribble system

Hello, can anyone help me make a dribble system like in RB World? I’m an animator and i’m working solo this time. And I really don’t know how to script, but i’ll show you guys what I have so far, and if you can help me script like a Crossover, Behind the back, switch hands etc. That would be very Helpful.

Screenshot 2021-07-11 202258

1 Like

The only problem i see with this script is that you are using the deprecated way of Loading the animation. Load it through the Animator

local animation = char.Humanoid.Animator:LoadAnimation(animations.Dribble)
1 Like

Ok, thank you very much, I will fix that right now.

I made a new script:

local Character = script.Parent
local Hit = nil

Character:WaitForChild(“Humanoid”).Touched:Connect(function(Hit)
if Hit.Name == “Basketball” then
if Character:FindFirstChild(“Ball”)then return end
if Hit:FindFirstChild(“Ball”)then return end

	local Weld = Instance.new("Motor6D",Character)
	Weld.Part0 = Character.HumanoidRootPart
	Weld.Part1 = Hit
	Weld.Name = "Ball_Weld"

	local CharacterBall = Instance.new("BoolValue",Character)
	local RegularBall = Instance.new("BoolValue",Hit)
	CharacterBall.Name = "Ball"
	RegularBall.Name = "Ball"
	

	local PickUp = Character.Humanoid:LoadAnimation(script.PickUp)
	PickUp:Play()
	PickUp.Stopped:Wait()
	
	local DribleRight = Character.Humanoid:LoadAnimation(script.DribbleRight)
	DribleRight:Play()
	
	local DribleLeft = Character.Humanoid:LoadAnimation(script.DribbleLeft)
	
	script.Values.Hand.Changed:Connect(function()
		if Character:FindFirstChild("Ball") then
			print(script.Values.Hand.Value)
			if script.Values.Hand.Value == "Right" then
				DribleRight:Play()
				DribleLeft:Stop()
				else
				DribleRight:Stop()
				DribleLeft:Play()
			end
			
			
		end
	end)
	
	script.Main.OnServerEvent:Connect(function(Action,Value)
		if Character:FindFirstChild("Ball") then
		if Action == "SwitchHands" then
			if script.Values.Hand.Value == "Right" then
				script.Values.Hand.Value = "Left"
			else
				script.Values.Hand.Value = "Right"
			end
			end
			end
	end)
	
end

end)