How to fix this?

Hey! So I made this script to be able to control a rocket, bascially when the orientation gets to like 90,blah,blah it stops rotating in the X. How to fix?

local userinput= game:GetService("UserInputService")
local Direct = game.ReplicatedStorage.RocketEvents.Direction
holdinga = false
holdingd = false
holdingw = false
holdings = false
userinput.InputBegan:Connect(function(k)
	if k.KeyCode == Enum.KeyCode.A then
		holdinga=true
		while holdinga == true do wait()
		for i = 1,25 do
				Direct:FireServer(0,0.00,-0.027)
				--if workspace.RealRocket.PrimaryPart.Orientation.Z == -90 then
				--	game.ReplicatedStorage.RocketEvents.ChangeOrientation:FireServer(-92)
				--end
		end
		end
		end
end)
userinput.InputEnded:Connect(function(k)
	if k.KeyCode == Enum.KeyCode.A then
		holdinga = false
	end
end)
userinput.InputBegan:Connect(function(k)
	if k.KeyCode == Enum.KeyCode.D then
		holdingd=true
		while holdingd == true do wait()
			for i = 1,25 do
				Direct:FireServer(0,0.00,0.027)
			end
		end
	end
end)
userinput.InputEnded:Connect(function(k)
	if k.KeyCode == Enum.KeyCode.D then
		holdingd = false
	end
end)

userinput.InputBegan:Connect(function(k)
	if k.KeyCode == Enum.KeyCode.W then
		holdingw=true
		while holdingw == true do wait()
			for i = 1,25 do
				Direct:FireServer(-0.027,0.00,0)
				--if workspace.RealRocket.PrimaryPart.Orientation.X == -90 then
				--	game.ReplicatedStorage.RocketEvents.ChangeOrientation2:FireServer(-95)
				--end
			end
		end
	end
end)
userinput.InputEnded:Connect(function(k)
	if k.KeyCode == Enum.KeyCode.W then
		holdingw = false
	end
end)
userinput.InputBegan:Connect(function(k)
	if k.KeyCode == Enum.KeyCode.S then
		holdings=true
		while holdings == true do wait()
			for i = 1,25 do
				Direct:FireServer(0.027,0.00,0)
			--	game.ReplicatedStorage.RocketEvents.ChangeOrientation:FireServer(182)
			end
		end
	end
end)
userinput.InputEnded:Connect(function(k)
	if k.KeyCode == Enum.KeyCode.S then
		holdings = false
	end
end)

Here this is what I mean I press w the whole time and it doesnt go up. https://gyazo.com/7f5175aed744ea17a0bad17c542f355b

Never mind, I fixed it all I had to do was use tweens.

nvm it still broken what it worked now it is broken again im confusde

here is the game so you can see what i mean if it helps you in any wayrockettests1.rbxl (9.2 MB)
the controls are
w
a
s
d

press launch to launch the rocket