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

Motor6D's don't work with LocalScripts or coding issue?

Asked by
1GlF 42
5 years ago

I recently have tried many ways to make Motor6D's work with LocalScripts, no success. (Tried print() too, works) However if I paste the same thing in a ServerScript, it works perfectly. Here's the code;

for i, v in pairs({FrontLeftMotor, FrontRightMotor, BackLeftMotor, BackRightMotor}) do
            if v and v.Parent then
                wait()
                local ActualBody = script.Parent:WaitForChild("Body")
                local movement = math.floor(ActualBody.Velocity.Magnitude)
                local DesiredAngle = (999999999 * (-movement/ math.abs(movement)))
                local MaxVelocity = (movement / 250)
                wait()
                v.DesiredAngle = DesiredAngle
                v.MaxVelocity = MaxVelocity
            end
        end

Answer this question