So I have a train model here, every time I try and start the trains movement. It’s limited to 9 SPS and then gets stuck constantly… Does anyone know a solution?
(or it flips out at me)
Script under the DriveSeat
local Speed = 120
local GlobalHinges = {
Left1 = script.Parent.Parent.Hinges.LeftWheel1,
Left2 = script.Parent.Parent.Hinges.LeftWheel2,
Right1 = script.Parent.Parent.Hinges.RightWheel1,
Right2 = script.Parent.Parent.Hinges.RightWheel2
}
script.Parent.Changed:Connect(function(Property)
GlobalHinges.Left1.AngularVelocity = Speed * script.Parent.Throttle * Speed
GlobalHinges.Right1.AngularVelocity = Speed * script.Parent.Throttle * Speed
GlobalHinges.Left2.AngularVelocity = Speed * script.Parent.Throttle * Speed
GlobalHinges.Right2.AngularVelocity = Speed * script.Parent.Throttle * Speed
end)
local GlobalHinges2 = {
Left1 = script.Parent.Parent.Parent["TrainChassis [Rear]"].Hinges.LeftWheel1,
Left2 = script.Parent.Parent.Parent["TrainChassis [Rear]"].Hinges.LeftWheel2,
Right1 = script.Parent.Parent.Parent["TrainChassis [Rear]"].Hinges.RightWheel1,
Right2 = script.Parent.Parent.Parent["TrainChassis [Rear]"].Hinges.RightWheel2
}
script.Parent.Changed:Connect(function(Property)
GlobalHinges2.Left1.AngularVelocity = -Speed * script.Parent.Throttle * Speed
GlobalHinges2.Right1.AngularVelocity = -Speed * script.Parent.Throttle * Speed
GlobalHinges2.Left2.AngularVelocity = -Speed * script.Parent.Throttle * Speed
GlobalHinges2.Right2.AngularVelocity = -Speed * script.Parent.Throttle * Speed
end)
Video