Skip to content

Instantly share code, notes, and snippets.

@UltiRequiem
Last active May 1, 2025 19:12
Show Gist options
  • Save UltiRequiem/1be670f0228bb94db6389caf318f7aca to your computer and use it in GitHub Desktop.
Save UltiRequiem/1be670f0228bb94db6389caf318f7aca to your computer and use it in GitHub Desktop.
local seat = script.Parent
local front_speed = 100
local up_speed = 5
local max_height = 20
local AngularVelocity = script.AngularVelocity
local LinearVelocity = script.LinearVelocity
while task.wait() do
AngularVelocity.AngularVelocity = Vector3.new(0, -1 * seat.Steer, 0) -- girar
if seat.Throttle == 1 then
LinearVelocity.VectorVelocity = Vector3.new(0, up_speed, -front_speed)
end
if seat.Throttle == -1 then
LinearVelocity.VectorVelocity = Vector3.new(0, -up_speed, -front_speed)
end
if seat.Throttle == 0 then -- avanzar sin cambios
LinearVelocity.VectorVelocity = Vector3.new(0, 0, -front_speed)
end
if seat.Throttle ~= 1 and math.round(seat.Position.Y - seat.Size.Y / 2) == 0 then
LinearVelocity.VectorVelocity = Vector3.new(0, 0, 0)
end
if seat.Position.Y + seat.Size.Y / 2 > max_height then
LinearVelocity.VectorVelocity = Vector3.new(0, -up_speed, -front_speed)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment