|
| 15 Sep 2012 10:49 PM |
im making a throttle control for my new airplane system, so when you hold a button to accelerate I dont want the plane taking off fast, I want it realistick like a jet so the throttle goes up then a script brings up the speed of the plane o the throttle speed. theres a problem were if I put 100 for the throttle and it starts counting when I change it to 50 it dosent count back down, it waits till after it counts to 100.
heres the script.
while true do wait() MaxSpeed = 100 Throttle = script.Parent.Throttle Speed = script.Parent.Speed
if Throttle.Value > MaxSpeed then Throttle.Value = MaxSpeed end if Throttle.Value < 0 then Throttle.Value = 0 end if Speed.Value > Throttle.Value then repeat wait(0.5) Speed.Value = Speed.Value - 1 print"speedChange-" until Speed.Value == Throttle.Value or elseif Speed.Value < Throttle.Value then repeat wait(0.5) Speed.Value = Speed.Value + 1 print"speedChange+" until Speed.Value == Throttle.Value or end end |
|
|
| Report Abuse |
|
Salinas23
|
  |
| Joined: 28 Dec 2008 |
| Total Posts: 37142 |
|
| |