The error “MaxTorque cannot be assigned to - Server,” suggests that there’s an issue with how you’re trying to set the MaxTorque property. This property belongs to AngularVelocity or BodyAngularVelocity constraints, so we need to ensure that the local variable angularVelocity can reference either of these constraints.
local seat = script.Parent.VehicleSeat
local backL = script.Parent.BackL
local backR = script.Parent.BackR
local frontL = script.Parent.FrontL
local frontR = script.Parent.FrontR
local angularVelocity = script.Parent.Base:FindFirstChild("BodyAngularVelocity") or script.Parent.Base:FindFirstChild("AngularVelocity")
seat.Changed:Connect(function ()
if seat.Throttle == 1 then
backL.HingeConstraint.AngularVelocity = 25
backL.HingeConstraint.MotorMaxTorque = 10000
elseif seat.Throttle == -1 then
backL.HingeConstraint.AngularVelocity = -25
backL.HingeConstraint.MotorMaxTorque = 10000
elseif seat.Throttle == 0 then
backL.HingeConstraint.AngularVelocity = 0
backL.HingeConstraint.MotorMaxTorque = 0
end
if seat.Steer == 1 then
if angularVelocity then
angularVelocity.MaxTorque = Vector3.new(0, 10000, 0)
angularVelocity.AngularVelocity = Vector3.new(0, -5, 0)
end
elseif seat.Steer == -1 then
if angularVelocity then
angularVelocity.MaxTorque = Vector3.new(0, 10000, 0)
angularVelocity.AngularVelocity = Vector3.new(0, 5, 0)
end
elseif seat.Steer == 0 then
if angularVelocity then
angularVelocity.MaxTorque = Vector3.new(0, 0, 0)
angularVelocity.AngularVelocity = Vector3.new(0, 0, 0)
end
end
end)