--Springs--


frontstiffness = 1290 * StiffnessFront /2
frontdamping = 40 *  StiffnessFront 

rearstiffness = 1290 * StiffnessRear /2
reardamping = 40 * StiffnessRear 

minLF = SuspensionTravelF
minLR = SuspensionTravelR
maxL = ((RideHeightRear + RideHeightFront)/2) + 4

ffl = RideHeightFront+2
rfl = RideHeightRear+2

local springFL = Instance.new("SpringConstraint", SFL)
springFL.Attachment0 = SFL.Attachment
springFL.Attachment1 = SSML.Attachment
springFL.Damping = frontdamping
springFL.FreeLength = ffl
springFL.Stiffness = frontstiffness
springFL.Visible = false
springFL.LimitsEnabled = true
springFL.MinLength = minLF
springFL.MaxLength = maxL

local springFR = Instance.new("SpringConstraint", SFR)
springFR.Attachment0 = SFR.Attachment
springFR.Attachment1 = SSMR.Attachment
springFR.Damping = frontdamping
springFR.FreeLength = ffl
springFR.Stiffness = frontstiffness
springFR.Visible = false
springFR.LimitsEnabled = true
springFR.MinLength = minLF
springFR.MaxLength = maxL

local springRL = Instance.new("SpringConstraint", SRL)
springRL.Attachment0 = SRL.Attachment
springRL.Attachment1 = BRL.Attachment
springRL.Damping = reardamping
springRL.FreeLength = rfl
springRL.Stiffness = rearstiffness
springRL.Visible = false
springRL.LimitsEnabled = true
springRL.MinLength = minLR
springRL.MaxLength = maxL

local springRR = Instance.new("SpringConstraint", SRR)
springRR.Attachment0 = SRR.Attachment
springRR.Attachment1 = BRR.Attachment
springRR.Damping = reardamping
springRR.FreeLength = rfl
springRR.Stiffness = rearstiffness
springRR.Visible = false
springRR.LimitsEnabled = true
springRR.MinLength = minLR
springRR.MaxLength = maxL


local XSteeringL = Instance.new("HingeConstraint", SSL)
XSteeringL.Attachment0 = SSL.Attachment
XSteeringL.Attachment1 = SSML.Attachment
XSteeringL.ActuatorType = "Motor"
XSteeringL.LimitsEnabled = true
XSteeringL.LowerAngle = SteeringAngle*-1
XSteeringL.UpperAngle = SteeringAngle
XSteeringL.MotorMaxTorque = 200000

local XSteeringR = Instance.new("HingeConstraint", SSR)
XSteeringR.Attachment0 = SSR.Attachment
XSteeringR.Attachment1 = SSMR.Attachment
XSteeringR.ActuatorType = "Motor"
XSteeringR.LimitsEnabled = true
XSteeringR.LowerAngle = SteeringAngle*-1
XSteeringR.UpperAngle = SteeringAngle
XSteeringR.MotorMaxTorque = 200000

local BGL = Instance.new("BodyGyro")
BGL.Parent = xSSL
BGL.Name = "Gyro"
BGL.D = 180
BGL.MaxTorque = Vector3.new(900, 0, 900)
BGL.P = 300

local BGR = Instance.new("BodyGyro")
BGR.Parent = xSSR
BGR.Name = "Gyro"
BGR.D = 180
BGR.MaxTorque = Vector3.new(900, 0, 900)
BGR.P = 300

local flip = Instance.new("BodyGyro", script.Parent)
flip.Name = "Flip"
flip.D = 1000
flip.MaxTorque = Vector3.new(0,0,0)
flip.P = 30000