local function N(N)local R=plane.Propeller if N then R.Hinge.DesiredAngle=1e+100 else local N=math.random(0,10)R.Hinge.DesiredAngle=N R.Hinge.CurrentAngle=N end end seat.Changed:connect(function(R)if R=="\079\099\099\117\112\097\110\116"then local R=seat.Occupant if R then N(true)local s=game.Players:GetPlayerFromCharacter(R.Parent)if s then plane.Body:SetNetworkOwner(s)local N=script.LocalPlaneScript:Clone()N.Parent=s.PlayerGui N.Plane.Value=plane N.Disabled=false else shooting=false end else N(false)end end end)while true do if seat.Occupant and shooting then for N,R in pairs(plane.Guns:GetChildren())do if R:FindFirstChild("\077\117\122\122\108\101")then local N=Instance.new("\080\097\114\116")N.Parent=R N.Anchored=false N.CanCollide=false N.FormFactor=Enum.FormFactor.Custom N.Size=Vector3.new(.4,10,.4)N.BrickColor=BrickColor.new("\066\114\105\103\104\116 \121\101\108\108\111\119")N.Material=Enum.Material.Neon Instance.new("\067\121\108\105\110\100\101\114\077\101\115\104",N);(Instance.new("\066\111\100\121\070\111\114\099\101",N)).Force=Vector3.new(0,N:GetMass()*196.2,0)N.CFrame=R.Muzzle.CFrame N.Velocity=N.CFrame:vectorToWorldSpace(Vector3.new(0,1,0))*2000 N:SetNetworkOwner(game.Players:GetPlayerFromCharacter(seat.Occupant.Parent))N.Touched:connect(function(R)if not R:IsDescendantOf(plane)and not R:IsDescendantOf(seat.Occupant.Parent)then local R=Instance.new("\069\120\112\108\111\115\105\111\110",game.Workspace)R.Position=N.Position R.BlastRadius=4 R.DestroyJointRadiusPercent=0 N:Destroy()end end)game.Debris:AddItem(N,1)end end end wait(.1)end
-- For effects and stuff
local function Engine(on)
	local prop = plane.Propeller

	if on then
		prop.Hinge.DesiredAngle = 1e100 -- Super huge number so the propeller doesn't stop spinning :D
	else
		local angle = math.random(0, 10)
		prop.Hinge.DesiredAngle = angle
		prop.Hinge.CurrentAngle = angle
	end
end

seat.Changed:connect(function(p)
	if p == "Occupant" then
		local occupant = seat.Occupant

		if occupant then
			Engine(true)
			local player = game.Players:GetPlayerFromCharacter(occupant.Parent)
			if player then
				plane.Body:SetNetworkOwner(player)
				local localPlaneScript = script.LocalPlaneScript:Clone()
				localPlaneScript.Parent = player.PlayerGui
				localPlaneScript.Plane.Value = plane
				localPlaneScript.Disabled = false
			else
				shooting = false
			end
		else
			Engine(false)
		end
	end
end)

while true do
	if seat.Occupant and shooting then
		for _, gun in pairs(plane.Guns:GetChildren()) do
			if gun:FindFirstChild("Muzzle") then
				local bullet = Instance.new("Part")
				bullet.Parent = gun
				bullet.Anchored = false
				bullet.CanCollide = false
				bullet.FormFactor = Enum.FormFactor.Custom
				bullet.Size = Vector3.new(0.4, 10, 0.4)
				bullet.BrickColor = BrickColor.new("Bright yellow")
				bullet.Material = Enum.Material.Neon
				Instance.new("CylinderMesh", bullet)
				Instance.new("BodyForce", bullet).Force = Vector3.new(0, bullet:GetMass() * 196.2, 0)
				bullet.CFrame = gun.Muzzle.CFrame
				bullet.Velocity = bullet.CFrame:vectorToWorldSpace(Vector3.new(0, 1, 0)) * 2000
				bullet:SetNetworkOwner(game.Players:GetPlayerFromCharacter(seat.Occupant.Parent))

				bullet.Touched:connect(function(hit)
					if not hit:IsDescendantOf(plane) and not hit:IsDescendantOf(seat.Occupant.Parent) then
						local explosion = Instance.new("Explosion", game.Workspace)
						explosion.Position = bullet.Position
						explosion.BlastRadius = 4
						explosion.DestroyJointRadiusPercent = 0
						bullet:Destroy()
					end
				end)

				game.Debris:AddItem(bullet, 1)
			end
		end
	end
	wait(0.1)
end
