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

Is it possible to use a Bezier Curve in a Tool's shooting script?

Asked by 5 years ago

I want my shooting function to be able to curve using a Bezier Curve, but I don't know if Bezier Curves can work with Tool's shooting scripts. If it's possible, may someone assist me on where to place it?

local Tool = script.Parent
local Ball = Tool.Handle

function fire(direction)

    Tool.Handle.Boing:play()

    local vCharacter = Tool.Parent
    local vPlayer = game.Players:playerFromCharacter(vCharacter)

    local missile = Tool
    missile.Parent = game.Workspace     

    local spawnPos = vCharacter.PrimaryPart.Position

    spawnPos  = spawnPos + (direction * 6.7)

    missile.Handle.Position = spawnPos
    missile.Handle.Velocity = direction * 84 + Vector3.new(0,27,0)

end

Tool.ThrowBall.OnServerEvent:connect(function(plr,direction)
    local char = game.Players:GetPlayerFromCharacter(Tool.Parent)
    if char and char.Name == plr.Name then
        fire(direction)
    end
end)
0
0
Almost, but when the ball is shot in that script, how do I lose the ball instead of it cloning itself? kenappleby -8 — 5y
0
You could use the ball itself instead of the clone and parent it to the workspace. Or you could use the clone and delete the original. User#20279 0 — 5y

Answer this question