-------------------Speed Controls ( Up/down/Forward/Backward)-------------------

				if(key == "d")  and (faster == false) and (slower == false) and (Spd_keep == true) and ( on == true) then 
					local val = plane.Engine:findFirstChild("Speed")
					faster = true
					while faster do
						if(val.Value < minspeed) or (val.Value > maxv) then return end							
						if(val.Value == maxv) then faster = false end 
						val.Value = val.Value +1
						wait()
						end 		
				
				elseif(key == "a")  and (faster == false)  and ( on==true) and (Spd_keep == true) then
				if(on == false) or (plane.Engine:findFirstChild("Speed") == nil) then return end
					if(slower == false) and (faster == false) then
						local val = plane.Engine:findFirstChild("Speed")
						slower = true
						while slower do
						if(val.Value >=minspeed) then
						val.Value = val.Value -1
						elseif(val.Value < minspeed) then
						val.Value = minspeed
						slower = false
						end 
						wait()
						end 
				end
					end 
			
			--Below u can see 2 if's these are if the Vert_keep value is set to true
				if(key == "s")  and planedebounce == false and on == true then
				local val = plane.Engine:findFirstChild("VerticalSpeed")
				if(val == nil) then return end
					downer = true
					uper = false 
					while downer do
					if(val.Value == -20) then downer = false break end
					if(downer==false) then break end
					val.Value = val.Value  -1
					wait(.1)
					end	
				end 

				if(key == "w")  and planedebounce == false and on == true then
				local val = plane.Engine:findFirstChild("VerticalSpeed")
				if(val == nil) then return end
					uper = true
					downer = false
					while uper==true do 
					if(uper == false) then break end
					if(val.Value >= 20) then
						uper = false
 
					end
					val.Value = val.Value +1
					
					wait(.1)
						end
				end 
		

	--[[	if(string.byte(key) == 20) and (on == true) then 
			local engine = plane.Engine
			local bg = engine.BodyGyro
				sideleft = true
				while sideleft do
				sideway = 20
				wait(.1)
			end
		end 
			
		if(string.byte(key) == 19) and (on == true) then 
			local engine = plane.Engine
			local bg = engine.BodyGyro
				sideright = true
				while sideright do
				sideway = -20
				wait(.1)
			end
		end 	]]--
	
		if(string.byte(key) == 23) and on then 
			local engine = plane.Engine
			local spd = engine.Speed
			if(spd.Value < 0) then 
			while spd.Value ~= 0 do
				spd.Value = spd.Value +1
			wait(.1)
			end
			elseif(spd.Value > 0) then 
			while spd.Value ~= 0 do
					spd.Value = spd.Value -1
			wait(.1)
			end
			elseif(spd.Value == 0) then spd.Value = 0
			return 
			end
		end 
