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

Help with BodyVelocity?

Asked by 9 years ago

I want to launch this fireball up to the sky. I've tried to play around with the numbers of Bodyvelocity but didn't work.Any suggestions?

Player = script.Parent.Parent.Parent
n = script.Parent
local debounce = false
mouse = Player:GetMouse()
run = game:GetService("RunService")
function pizza(mouse)
    if debounce == false then
        debounce = true
            local x = Instance.new("Part")
            x.Shape = "Ball"
            x.CanCollide = false
            x.TopSurface = "Smooth"
            x.BottomSurface = "Smooth"
            x.Transparency = 0.2
            x.Parent = Workspace
            x.Size = Vector3.new(10, 50, 10)
            x.BrickColor = BrickColor.new("Brown")
            x.Name = Player.Name
            y = Instance.new("BodyVelocity")
            y.maxForce = Vector3.new(0, math.huge, 0)
            y.velocity = Player.Character.Torso.CFrame.lookVector*110
            x.Parent = Workspace
            y.Parent = x
            x.CFrame = Player.Character.Torso.CFrame*CFrame.new(0, 0, -10)
            game.Debris:AddItem(x, 10)

    end
    wait(35)
    debounce = false
end




function onSelected(mouse)
    mouse.Button1Down:connect(function() pizza(mouse) end)
end

n.Selected:connect(onSelected)


1 answer

Log in to vote
0
Answered by
parkderp1 105
9 years ago

For the velocity set it to: (Player.Character.Torso.CFrame.lookVector*110).unit

Ad

Answer this question