Advertisement
rynappel

Untitled

Oct 6th, 2023
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. wait(1)-- give it time to adjust to the scary and new environment of Backpack
  2.  
  3. local TurnAngle = 12 -- turning angle
  4. local offset = 10 -- keep this 10 for I dont know reasons why -- rynappel
  5. ----------------
  6.  
  7. SeatValue = script:WaitForChild("Seat")-- orient ourselves to the car we are sitting in
  8. if SeatValue:IsA("ObjectValue") and SeatValue.Value and SeatValue.Value:IsA("VehicleSeat") then
  9. seat = SeatValue.Value
  10. car = seat.Parent
  11. if seat:FindFirstChild("RocketPropulsion") then
  12. seat.RocketPropulsion:Fire()--THIS DOESNT WORK MEGA QQ
  13. end
  14. while seat:FindFirstChild("SeatWeld") do--what this loop does is continue running until the
  15. wait()--statement between the "while" and "do" is not true.
  16. if car:FindFirstChild("LeftMotor") then
  17. car.LeftMotor.DesiredAngle = seat.Steer*math.rad(TurnAngle-seat.Velocity.magnitude/offset)
  18. end
  19. if car:FindFirstChild("RightMotor") then
  20. car.RightMotor.DesiredAngle = seat.Steer*math.rad(TurnAngle-seat.Velocity.magnitude/offset)
  21. end
  22. --[[if car:FindFirstChild("Configuration") then
  23. if seat.Throttle == 1 and car.Configuration:FindFirstChild("Forwards Speed") then
  24. seat.MaxSpeed = car.Configuration["Forwards Speed"].Value
  25. elseif seat.Throttle == 0 then
  26. seat.MaxSpeed = 0
  27. elseif seat.Throttle == -1 and car.Configuration:FindFirstChild("Reverse Speed") then
  28. seat.MaxSpeed = car.Configuration["Reverse Speed"].Value
  29. end
  30. end--]]
  31. end
  32. -- the interesting thing about loops is they stop everything below them from running
  33. -- until the loop stops. When the loop stops because the player is no longer sitting
  34. -- the below code will run:
  35. if seat:FindFirstChild("RocketPropulsion") then
  36. seat.RocketPropulsion:Abort()--I'LL JUST LEAVE IT IN IN CASE IT EVER DOES
  37. end
  38. end
  39. script:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement