You are supposed to click the ball and get the ball (works)
Then when you click again the ball should launch forward (Does not work!)
local function move(player)
local cf = player.Character.PrimaryPart.CFrame.LookVector
game:GetService('TweenService'):Create(script.Parent.Parent,TweenInfo.new(0.3,Enum.EasingStyle.Quint,Enum.EasingDirection.Out,0,false,0),{CFrame = player.Character.PrimaryPart.CFrame*CFrame.new(0,-2,-4)}):Play()
end
held = false
db = false
script.Parent.Parent.ClickDetector.MouseClick:Connect(function(player)
db = false
while wait() do
if db == false then
move(player)
end
end
local mouse = player:GetMouse()
mouse.Button1Down:Connect(function()
db = true
wait(1)
script.Parent.Parent.CanCollide = true
script.Parent.Parent.Anchored = false
local bodyV = Instance.new("BodyVelocity")
bodyV.Parent = script.Parent.Parent
local cf = player.Character.PrimaryPart.CFrame.LookVector
local Force = 10
bodyV.Velocity = cf * Force
end)
end)