Is there a way to make a simple plane script?

Is there away to make a simple plane script? I have seen some free models but they are still complicated and have alot of code inside of them.

7 Likes

Well, to make it simple you can just use the old 2007 roblox concept of a plane like the Base Wars Vortex,

Press Y to activate the antigravity fly/hover mode,
In this mode the plane is oriented towards mouse position,
Then press a button to apply a vector force to fly towards the mouse location.

Any problems you face that are undesirable to a plane, you have to build up on your own.

Eventually your plane script will become as complicated as the free models if you desire full functionality.

4 Likes

Making a functional plane isn’t as hard as you think you just need to take the time to figure out how to make it. You can use what @dthecoolest said about vectors and add on to it. This isn’t a one day thing. I hope you can make your own flying plane. :slight_smile:

Not an ideal plane but an educational one

simple plane script == Simple Flying

Simple Plane

BodyGyro and BodyPosition and BodyVelocity

This code when placed inside a Script in VehicleSeat

local VehicleSeat = script.Parent
local maxspeed = VehicleSeat.MaxSpeed
maxspeed = 200
local value1 = 0

local bodyGyro = Instance.new("BodyGyro")
bodyGyro.MaxTorque = Vector3.new(math.huge, math.huge, math.huge)
bodyGyro.P = 3000
bodyGyro.D = 500
bodyGyro.Parent = VehicleSeat

bodyGyro.cframe = VehicleSeat.CFrame
local bodyPosition = Instance.new("BodyPosition")
bodyPosition.MaxForce = Vector3.new(0, math.huge, 0)
bodyPosition.P = 10000
bodyPosition.D = 1250
bodyPosition.Parent = VehicleSeat
bodyPosition.Position = VehicleSeat.Position

local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.P = 1250
bodyVelocity.Velocity = Vector3.new(0,0,0)
bodyVelocity.MaxForce = Vector3.new(math.huge, 0, math.huge)
bodyVelocity.Parent = VehicleSeat

while true do
wait()

if VehicleSeat.Throttle == 1 then
if value1 < maxspeed then value1 = value1 + 1 end
bodyVelocity.velocity = VehicleSeat.CFrame.lookVector * value1
end

if VehicleSeat.Throttle == 0 then
value1 = 0
bodyVelocity.velocity = VehicleSeat.CFrame.lookVector * value1
end

if VehicleSeat.Throttle == -1 then
if VehicleSeat.Steer == -1 then
bodyPosition.Position = VehicleSeat.CFrame * Vector3.new(0,10,0)
end
end

if VehicleSeat.Throttle == -1 then
if VehicleSeat.Steer == 0 then
bodyPosition.Position = VehicleSeat.CFrame * Vector3.new(0,-10,0)
end
end

if VehicleSeat.Steer == 1 then
bodyGyro.cframe = bodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,-.1,0)
end

if VehicleSeat.Steer == -1 then
if VehicleSeat.Throttle == 0 or VehicleSeat.Throttle == 1 then
bodyGyro.cframe = bodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,.1,0)
end
end

end

Get a free model plane at Toolbox

Make all parts of the plane Anchored = false

Welding all parts of the plane to the VehicleSeat

Control

11 Likes

Free airplane model from Toolbox

2 Likes

I used to use BodyVelocity and BodyGyro. BodyVelocity to move it in the direction the plane was facing. BodyGyro to set orientation. It’s not very realistic, but it works.

It’s hard to not make it complicated though. Planes are complex in nature.

5 Likes

It is intended for learning only, and not suitable for play

I am a beginner, I am not a professional and I am not good at making airplanes

I have another plane I am waiting for you to give me your opinion on it

I will send a video clip of the other plane

3 Likes

I’m trying to make a plane, but I’m not making a good plane

Free airplane model from Toolbox

2 Likes

If I new how to script, I’d help you.

But I have no experience. Sorry! :grimacing:

1 Like

If you want a smoother stop replace

if VehicleSeat.Throttle == 0 then
value1 = 0
bodyVelocity.velocity = VehicleSeat.CFrame.lookVector * value1
end

with

if script.Parent.Throttle == 0 then
		for i = value1, 0, -1 do
			bodyvelocity.velocity = script.Parent.CFrame.lookVector * i
			wait(.01)
		end
		value1 = 0	
	end
2 Likes

Good suggestion, I’ll try it on Airplane Code