Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How do I edit this script to reach my goal?

Asked by
Hakupa 0
9 years ago

Here is the long code: seat = script.Parent train = seat.Parent a = train.MoverA.BodyVelocity b = train.MoverB.BodyVelocity c = train.MoverC.BodyVelocity d = train.MoverD.BodyVelocity e = train.MoverE.BodyVelocity f = train.MoverF.BodyVelocity a.maxForce = Vector3.new(math.huge,math.huge,math.huge) b.maxForce = Vector3.new(math.huge,math.huge,math.huge) c.maxForce = Vector3.new(math.huge,math.huge,math.huge) d.maxForce = Vector3.new(math.huge,math.huge,math.huge) e.maxForce = Vector3.new(math.huge,math.huge,math.huge) f.maxForce = Vector3.new(math.huge,math.huge,math.huge)

while true do wait(0.5) if seat.Throttle == 1 then a.velocity = a.Parent.CFrame.lookVectorseat.Throttle15 b.velocity = b.Parent.CFrame.lookVectorseat.Throttle15 c.velocity = a.Parent.CFrame.lookVectorseat.Throttle15 d.velocity = b.Parent.CFrame.lookVectorseat.Throttle15 e.velocity = a.Parent.CFrame.lookVectorseat.Throttle15 f.velocity = b.Parent.CFrame.lookVectorseat.Throttle15 wait(1) a.velocity = a.Parent.CFrame.lookVectorseat.Throttle30 b.velocity = b.Parent.CFrame.lookVectorseat.Throttle30 c.velocity = a.Parent.CFrame.lookVectorseat.Throttle30 d.velocity = b.Parent.CFrame.lookVectorseat.Throttle30 e.velocity = a.Parent.CFrame.lookVectorseat.Throttle30 f.velocity = b.Parent.CFrame.lookVectorseat.Throttle30 wait(1) a.velocity = a.Parent.CFrame.lookVectorseat.Throttle60 b.velocity = b.Parent.CFrame.lookVectorseat.Throttle60 c.velocity = a.Parent.CFrame.lookVectorseat.Throttle60 d.velocity = b.Parent.CFrame.lookVectorseat.Throttle60 e.velocity = a.Parent.CFrame.lookVectorseat.Throttle60 f.velocity = b.Parent.CFrame.lookVectorseat.Throttle60 end if seat.Throttle == 0 then a.velocity = a.Parent.CFrame.lookVectorseat.Throttle30 b.velocity = b.Parent.CFrame.lookVectorseat.Throttle30 c.velocity = a.Parent.CFrame.lookVectorseat.Throttle30 d.velocity = b.Parent.CFrame.lookVectorseat.Throttle30 e.velocity = a.Parent.CFrame.lookVectorseat.Throttle30 f.velocity = b.Parent.CFrame.lookVectorseat.Throttle30 wait(1) a.velocity = a.Parent.CFrame.lookVectorseat.Throttle15 b.velocity = b.Parent.CFrame.lookVectorseat.Throttle15 c.velocity = a.Parent.CFrame.lookVectorseat.Throttle15 d.velocity = b.Parent.CFrame.lookVectorseat.Throttle15 e.velocity = a.Parent.CFrame.lookVectorseat.Throttle15 f.velocity = b.Parent.CFrame.lookVectorseat.Throttle15 wait(1) a.velocity = a.Parent.CFrame.lookVectorseat.Throttle0 b.velocity = b.Parent.CFrame.lookVectorseat.Throttle0 c.velocity = a.Parent.CFrame.lookVectorseat.Throttle0 d.velocity = b.Parent.CFrame.lookVectorseat.Throttle0 e.velocity = a.Parent.CFrame.lookVectorseat.Throttle0 f.velocity = b.Parent.CFrame.lookVectorseat.Throttle0 end end

as you can see, there is a while true do loop. What it does: When I use the arrow keys while in the vehicle seat, and hold down the button, the speed is 15, then goes up to 30, then to 60, then starts the loop over. What I want: When the throttle becomes 1, I want the speed to go to 15, then the 30, then stay at 60 until the throttle is 0, and then the speed will become 30, then 0, until the throttle becomes 1 again. How do I edit the script to reach this goal? I know this is a pretty long script, but any help is appreciated!

Answer this question