local rs = game:GetService("RunService")
local uis = game:GetService("UserInputService")
local char = script.Parent
local hum = char:WaitForChild("Humanoid")
-- others
local seat = nil
local fuselage = nil
local vectorForce = nil
local attachment = nil
-- Flight variables
local thrust = 0
local groundVelocity = nil
local airVelocity = nil
local drag = 0
local lift = 0
hum.Seated:Connect(function(isSeated, seatPart)
seat = seatPart
fuselage = seat.Parent:WaitForChild("Fuselage")
vectorForce = Instance.new('VectorForce', fuselage)
attachment = Instance.new('Attachment',fuselage)
vectorForce.Attachment0 = attachment
attachment.WorldOrientation = Vector3.zero
rs.PostSimulation:Connect(function(deltaTimeSim: number)
if uis:IsKeyDown(Enum.KeyCode.E) then thrust = 2000 * deltaTimeSim end
if uis:IsKeyDown(Enum.KeyCode.Q) then thrust = -2000 * deltaTimeSim end
vectorForce.Force += Vector3.new(0, 0, -thrust)
end)
end)
#Plane scripting help
1 messages · Page 1 of 1 (latest)