Making a helicopter like Jailbreak?

Alright so I have got this random model from the toolbox. I was just surfing around the toolbox. I’ve been playing Jailbreak since 2017 and I’ve been wondering how do I make a helicopter that is drivable and the controls are like similar to Jailbreak.

The problem is, I do not know where to start! I don’t know much about body movers. I am not a professional scripter unlike badcc. But I really wonder of how did they do these mechanics. How did they do those mechanics. I really don’t know where to start. Please help me!

I’ve tried surfing on the internet looking for tutorials but I cannot find a single tiny weeny tutorial that is worth a try. If you know something where I can start, let me know down in the replies. I am really interested of learning these things right now. As always reply below if you have any ideas, suggestions, etc.

7 Likes

For me, making helicopter is easier than making car, …, bec you musnt solve some problems made by terrain.
Ok so first you need to add body velocity and set its max force to 0,x,0 (idk, so test what number is good for x) and its velocity will be 0,y,0 and y is value edited by script (it is helicopters Y axis velocity). Now you need to make front/back and left/right, for that, use body velocity with max force x,0,x (again test it) and use script to set velocity, here its usefull to use CFrame:vectorToWorldSpace, bec the velocity has relative position, but absolute rotation. And for the rotation, use body angular velocity, there just set its max force to 0,x,0 and its velocity to rotation speed. And for having it rotated front down, use body gyro and there, set max force to x,0,x (again, idk exact values) and set the cframe to CFrame.Angles(a,0,b) (put your rotation insted of a or b depending on how the model is oriented, when the orientation is 0) and do CFrame:ToWorldSpace().
Really sry for my english or my decribtion skills.

5 Likes

I am really confused what you’re trying to describe.
Is there any possible way to provide a free model or script?
That would help and mean a lot.
Thanks

2 Likes

Idk what you mean, but y should automatically go higher, when x is high / big enough.

1 Like

model: idk
script:

local mainPart = --main part of the helicopter
local vehicleSeat = --vehicle seat
local bodyGyro = --body gyro with max force about 4k,0,4k
local bodyVelocity = --body velocity with max force about 10k,0,10k
local bodyAngularVelocity = --body angular velocity with max force about 0,4k,0
local bodyVelocity2 = --body velocity with max force about 0,100k,0 or heigher
while wait() do
    bodyGyro.CFrame = mainPartCFrameWithoutXAndYRotation:ToWorldSpace(rotationCFrame)
    local velocity = Vector3.new(0,0,vehicleSeat.Throttle*speed)
    bodyVelocity.Velocity = mainPart.CFrame:VectorToWorldSpace(velocity)
    local steer = Vector3.new(0,vehicleSeat.Steer*steerSpead,0)
    bodyAngularVelocity.AngularVelocity = steer
end
--this is for rotation and front/back, next code is for up/down
function upDown (speed)
    bodyVelocity2.Velocity = Vector3.new(0,speed,0)
end
--some function firing upDown with speed positive when going up and negative, when going down

sry if it doesnt work, has permutated axis, … i cant test it now

8 Likes

This might help, it’s not exactly like jailbreak but it might be somewhere to start:

12 Likes

This is what I exactly needed
TYSM! <3!

1 Like

Alright thanks @Jaycbee05! I found the solution I wanted and so I’ve been messing around with code so I got it to work like Jailbreak! THANKS VERY MUCH LIFE SAVER.

Now when I throttle its normal when I stop holding W it automatically stops instead of slowing down until stops. How would I make it slowdown when I stop holding W (the forward button)?

Would I use for loops like for i = 1,10 loops?

Full code i’ve been messing around with:

--Localscript
local ContextActionService = game:GetService("ContextActionService")

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local plane = script.Obj.Value

local RunService = game:GetService("RunService")
local height = 0
local turn = 0
local moving = 0
local Tilt = 0


local MoveRightKeyDown = false
local MovetLeftKeyDown =false

local vel = plane.Main.BodyVelocity
local tru = plane.Main.BodyForce
local BodyGyro = plane.Main.BodyGyro

local speed = 20

function MoveUp(action_name, action_state)
	if action_state == Enum.UserInputState.Begin then
		height = 50
	end
	if action_state == Enum.UserInputState.End then
		height = 0
	end
end

function MoveDown(action_name, action_state)
	if action_state == Enum.UserInputState.Begin then
		height = -50
	end
	if action_state == Enum.UserInputState.End then
		height = 0
	end
end

function MoveLeft(action_name, action_state)
	MovetLeftKeyDown = false
	if action_state == Enum.UserInputState.Begin then
MovetLeftKeyDown = true
	while MovetLeftKeyDown do
		wait(0.1)
		turn = turn + 5
	end
	 elseif action_state == Enum.UserInputState.End then
      MovetLeftKeyDown = false
end

end



function MoveRight(action_name, action_state)
	MoveRightKeyDown = false
	if action_state == Enum.UserInputState.Begin then
MoveRightKeyDown = true
	while MoveRightKeyDown do
		wait(0.1)
		turn = turn - 5
end
	 elseif action_state == Enum.UserInputState.End then
      MoveRightKeyDown = false
end

end

function MoveForward(action_name, action_state)
	if action_state == Enum.UserInputState.Begin then
		moving = -2500
		 Tilt = -10
	end
	if action_state == Enum.UserInputState.End then
		moving = 0
		 Tilt = 0
	end
end

function MoveBackwards(action_name, action_state)
	if action_state == Enum.UserInputState.Begin then
		moving = 5000
		 Tilt = 10
	end
	if action_state == Enum.UserInputState.End then
		moving = 0
		Tilt = 0
	end
end



RunService:BindToRenderStep("Update", Enum.RenderPriority.Input.Value, function()
	
	BodyGyro.CFrame = CFrame.Angles(0, math.rad(turn), 0) * CFrame.Angles(math.rad(Tilt), 0, 0)
	tru.Force = plane.Main.CFrame.LookVector * (-moving * 2 )
	vel.Velocity = Vector3.new(0,height,0)
	
end)

ContextActionService:BindAction("Down", MoveDown, false, "q")
ContextActionService:BindAction("Up", MoveUp, false, "e")
ContextActionService:BindAction("Left", MoveLeft, false, "a")
ContextActionService:BindAction("Right", MoveRight, false, "d")
ContextActionService:BindAction("Forward", MoveForward, false, "w")
ContextActionService:BindAction("Backwards", MoveBackwards, false, "s")

The move forward line function:

function MoveForward(action_name, action_state)
	if action_state == Enum.UserInputState.Begin then
		moving = -2500
		 Tilt = -10
	end
	if action_state == Enum.UserInputState.End then
		moving = 0
		 Tilt = 0
	end
end

When Enum UserInputState ends I set moving back to 0 means my heli instantly stops instead of slowing down until it stops.

UPDATE:

I found a fix! The controls are priotizing the helicopter controls instead of player controls. So I Unbind every action that the controls are involved inside the heli.

example:

ContextActionService:UnbindAction("ActionNameHere")
9 Likes