--FlyScript...Build in PlaneFlyer

script.Parent.Parent.Parent.Character:findFirstChild("Plane").Parts.Values.On.Changed:connect(function()
if(script.Parent.Parent.Parent.Character:findFirstChild("Plane").Parts.Values.On.Value == true) then 
local engine = script.Parent.Parent.Parent.Character:findFirstChild("Plane").Parts.Engine
local position = engine.Position
bv = engine.BodyVelocity
bv.velocity = Vector3.new(0,0,0)
while on do
	wait(.1)
	speed = engine.Speed.Value
	spd = (speed/100)*5
	dir = engine.CFrame.lookVector 
	VertSpd = engine.VerticalSpeed.Value
	bv.velocity = dir * (spd*0.422*50)+Vector3.new(0,(VertSpd)+(spd),0)
if(script.Parent.Parent.Parent.Character:findFirstChild("Plane").Parts.Values.On.Value == false) then break end
end 
end 
end)

function getBullet(Type)
local founddd = false
for _,v in pairs(vParts:GetChildren()) do
if v.Name == Type then
fireB(Type,v)
founddd = true
end
end
end

function getairtoground(mousetar,Type)
if mousetar == nil then return end
local as = mousetar.Parent
for i=1,math.huge do
if (as.className == "Part") or (as.className == "WedgePart") and (as.Parent ~= vParts) or (as.Parent ~=vParts.Parent.Body) then break end
if as == workspace then return end
as = as.Parent
end
local foundtar = false
if(Type.Name == "Launch1") or(Type.Name == "Launch2") then
v = Type
fireHo(v,mousetar)
foundtar = true
end
end

function Getmissile(Type)
if(plane:findFirstChild(Type)~= nil) then 
if(plane:findFirstChild(Type).className == "Part") then 
if(Type == "LaunchA") then

	if(hydra.left ~= 0) then 
	hydra.left = hydra.left -1
fire(plane.Parent,plane:findFirstChild("LaunchA"))
	end
elseif(Type == "LaunchB") then 

	if(hydra.right ~= 0) then 
		hydra.right = hydra.right -1
fire(plane.Parent,plane:findFirstChild("LaunchB"))
	end
end 
end
end
end 
