Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

Moving the ball is apparently not working?

Asked by 5 years ago
Edited 5 years ago
local CAS = game:GetService("ContextActionService")
local mound = game.Workspace:FindFirstChild("Pitcher's Mound", true)
local plr = game.Players:GetPlayerFromCharacter(mound)
local m = plr:GetMouse()
local FourSeamFB = function()
    if plr then
        if CAS:BindAction("KeyPress", onKeyPress, false, Enum.KeyCode.Four) then
            if m then
            local fourseam = Instance.new("Part")
            fourseam.Parent = game.Workspace
            fourseam.Size = Vector3.new(2,2,2)
            fourseam.Shape = 0
            fourseam.Position = plr.Character.RightHand.Position
            fourseam.CanCollide = false
            fourseam.Anchored = true
            local fourbvelo = Instance.new("BodyVelocity")
            fourbvelo.Parent = fourseam
            fourbvelo.velocity = Vector3.new(75,0,0)
            wait()
            fourseam.Anchored = false
        end
    end
end
mound.Touched:Connect(FourSeamFB)

The title explains my question.

0
"if m." what? you forgot the then. radusavin366 617 — 5y
0
sorry about that, but that is not the problem. DeceptiveCaster 3761 — 5y
0
Line 12, why did you assign shape a number? It’s an enum value. and line 18, it’s Velocity not velocity. Scripting is case sensitive. User#19524 175 — 5y
0
hierarchy? Araknala 14 — 5y
0
Line 7, is 'onKeyPress' supposed to be there? Shouldn't it be replaced with whatever is in the function's parentheses? Araknala 14 — 5y

Answer this question