I need help with my basketball SHOOTING system

Hello! So basically I have this script I made so that when you have the ball and you tap e, you would shoot the ball and it would play a jumpshot animation. I’m having trouble figuring out whats wrong with my code. Can you please help me?

Client:

local player = game.Players.LocalPlayer
local character = player.Character
local rep = game:GetService("ReplicatedStorage")
local uis = game:GetService("UserInputService")
local jumpshot = rep.Animations:WaitForChild("jumpshot animation")
local jumpshotanimation = character.Humanoid:LoadAnimation(jumpshot)
local shoot = rep.Events:WaitForChild("shoot")
local Basketball = game.Workspace.Basketball
local ShotBall = false
local Debounce = true

uis.InputBegan:Connect(function(input)
	if input.KeyCode == Enum.KeyCode.E and not Debounce and not ShotBall and character.Humanoid:FindFirstChild(Basketball) then
		ShotBall = true
		Debounce = false
		jumpshotanimation:Play()
		wait()
		Debounce = true
		ShotBall = false
		shoot:FireServer()
	end
end)

Server:

local rep = game:GetService("ReplicatedStorage")
local shoot = rep.Events:WaitForChild("shoot")
local GoalPart = game.Workspace.Hoop.GoalPart
local Basketball = game.Workspace.Basketball
local ShotBall = false

shoot.OnServerEvent:Connect(function(player)
	local mag = (GoalPart.Position - player.Character.HumanoidRootPart.Position).Magnitude
	local unit = (GoalPart.Position - player.Character.HumanoidRootPart.Position).Unit
	if ShotBall == false then
		Basketball.Velocity = (unit * mag) + Vector3.new(0, 70, 0)
		Basketball.Ball.Part0 = nil
		Basketball.Parent = workspace
		ShotBall = true
	end
	ShotBall = false
end)

I would really appreciate your help. Thank you and remember to stay safe.

4 Likes

You have show Debounce = true in the vairable so i think u should remove “not”.
Or
You could just change the variable’s value to false

Did you figure it out and if you did… How and also I’m making a basketball shooting system too so can you help me?

1 Like

Yes I did figure it out. If you need help hit me up. Here’s my discord:
Pumpstormz#9090

4 Likes

Is that still your cord? I got a few questions to ask too I’m making a basketball game also.

Is that still your discord, I need some help too with my shot meter.