← Back to Football Scripts

Ball Kick Script

Customize your variables, then fill in the blanks!

Your Custom Settings

How long before ball stops

Script (inside the Ball part)

This script makes the ball kick in the direction the player is facing when touched. Add a "Speed" attribute to your ball first!

local ball = script.Parent
ball.:Connect(function(hit)
    local char = hit.
    if char:FindFirstChild("") then
        local fwd = char.HumanoidRootPart.CFrame.
        local speed = ball:GetAttribute("Speed")
        ball:ApplyImpulse(speed * fwd * ball.AssemblyMass)
        wait(1)
        ball.AssemblyLinearVelocity = Vector3.zero
    end
end)