Why does my script not reload another part?

this is a client script, located in startergui, i am using motor6d instead of welds to prevent any issues, and the issue here is that the ball doesn’t get cloned into the player’s hand when the ball is thrown, and if possible pls make a debounce and cooldown in it pls
script:

local ball = workspace.Ball
local plr =  game.Players.LocalPlayer
local char = plr.Character
local hum = char:FindFirstChildOfClass("Humanoid")
local mouse = plr:GetMouse()
local hand = char:WaitForChild("LeftHand")
local anim = script:WaitForChild("Explode")
local animator = hum:FindFirstChildOfClass("Animator")
local track = animator:LoadAnimation(anim)

local clone = ball:Clone()
clone.Parent = char
clone.Name = "BallClone"
clone.CanCollide = false

local motor6d =  Instance.new("Motor6D")
motor6d.Parent = hand
motor6d.Part0 = clone
motor6d.Part1 = hand
motor6d.Name = "BallMotor"

mouse.Button1Down:Connect(function()
    track:Play()
    hum.WalkSpeed = 0
    track.Stopped:Wait()
    hum.WalkSpeed = 16
    motor6d:Destroy()
    wait(0.5)
    while wait() do
    local clone2 = clone:Clone()
    clone2.Parent = hand
    local motor = motor6d:Clone()
    motor.Parent = hand
    motor.Part0 = clone
    motor.Part1 = hand
    clone:Destroy()
    break
    end
end)

I believe you made a typo

(character limit)

1 Like