local x=0 function getMass(g)for g,u in pairs(g:GetChildren())do if u:IsA("\066\097\115\101\080\097\114\116")and not u.Massless then x=x+u:GetMass()end getMass(u)end end getMass(car)if x<(_Tune.Weight/2.205)/8 then local g=Vector3.new()local u=Vector3.new()local e=0 local Y=0 for x,v in pairs(Drive)do if v.Name=="\070\076"or v.Name=="\070\082"or v.Name=="\070"then g=g+v.CFrame.p e=e+1 else u=u+v.CFrame.p Y=Y+1 end end g=g/e u=u/Y local v=u:Lerp(g,_Tune.WeightDist/100)local R=Instance.new("\080\097\114\116",car.Body)R.Name="\035\087\101\105\103\104\116"R.Anchored=true R.CanCollide=false R.BrickColor=BrickColor.new("\082\101\097\108\108\121 \098\108\097\099\107")R.TopSurface=Enum.SurfaceType.Smooth R.BottomSurface=Enum.SurfaceType.Smooth if _Tune.WBVisible then R.Transparency=.75 else R.Transparency=1 end R.Size=Vector3.new(_Tune.WeightBSize[1],_Tune.WeightBSize[2],_Tune.WeightBSize[3])local G=((_Tune.Weight/2.205-x/8)/((((R.Size.x*R.Size.y)*R.Size.z)*1000)/61024))/1000 R.CustomPhysicalProperties=PhysicalProperties.new(G,0,0,0,0)R.CFrame=((car.DriveSeat.CFrame-car.DriveSeat.Position)+v)*CFrame.new(0,_Tune.CGHeight,0)if R.CustomPhysicalProperties.Density>=2 then warn("\n\t \091\065\067\054\067 \086"..(_BuildVersion..("\093\058 \068\101\110\115\105\116\121 \116\111\111 \104\105\103\104 \102\111\114 \115\112\101\099\105\102\105\101\100 \118\111\108\117\109\101\046"..("\n\t \067\117\114\114\101\110\116 \068\101\110\115\105\116\121\058\t"..(math.ceil(G)..("\n\t \077\097\120 \068\101\110\115\105\116\121\058\t"..(math.ceil(R.CustomPhysicalProperties.Density).."\n\t \073\110\099\114\101\097\115\101 \119\101\105\103\104\116 \098\114\105\099\107 \115\105\122\101 \116\111 \099\111\109\112\101\110\115\097\116\101\046")))))))end else warn("\n\t \091\065\067\054\067 \086"..(_BuildVersion..("\093\058 \077\097\115\115 \116\111\111 \104\105\103\104 \102\111\114 \115\112\101\099\105\102\105\101\100 \119\101\105\103\104\116\046"..("\n\t    \084\097\114\103\101\116 \077\097\115\115\058\t"..(math.ceil((_Tune.Weight*2.205)*8)..("\n\t    \067\117\114\114\101\110\116 \077\097\115\115\058\t"..(math.ceil(x).."\n\t \082\101\100\117\099\101 \112\097\114\116 \115\105\122\101 \111\114 \097\120\108\101 \100\101\110\115\105\116\121 \116\111 \097\099\104\105\101\118\101 \100\101\115\105\114\101\100 \119\101\105\103\104\116\046")))))))end local g=Instance.new("\066\111\100\121\071\121\114\111",car.DriveSeat)g.Name="\070\108\105\112"g.D=0 g.MaxTorque=Vector3.new(0,0,0)g.P=0
	
	--Determine Current Mass
	local mass=0
	
	function getMass(p)
		for i,v in pairs(p:GetChildren())do
			if v:IsA("BasePart") and not v.Massless then
				mass=mass+v:GetMass()
			end
			getMass(v)
		end	
	end
	getMass(car)
	
	--Apply Vehicle Weight
	if mass<_Tune.Weight/2.205/8 then
		--Calculate Weight Distribution
		local centerF = Vector3.new()
		local centerR = Vector3.new()
		local countF = 0
		local countR = 0
		
		for i,v in pairs(Drive) do
			if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
				centerF = centerF+v.CFrame.p
				countF = countF+1
			else
				centerR = centerR+v.CFrame.p
				countR = countR+1
			end
		end
		centerF = centerF/countF
		centerR = centerR/countR
		local center = centerR:Lerp(centerF, _Tune.WeightDist/100)  
		
		--Create Weight Brick
		local weightB = Instance.new("Part",car.Body)
		weightB.Name = "#Weight"
		weightB.Anchored = true
		weightB.CanCollide = false
		weightB.BrickColor = BrickColor.new("Really black")
		weightB.TopSurface = Enum.SurfaceType.Smooth
		weightB.BottomSurface = Enum.SurfaceType.Smooth
		if _Tune.WBVisible then
			weightB.Transparency = .75			
		else
			weightB.Transparency = 1			
		end
		
		weightB.Size = Vector3.new(_Tune.WeightBSize[1],_Tune.WeightBSize[2],_Tune.WeightBSize[3])
		local tdensity=(_Tune.Weight/2.205-mass/8)/(weightB.Size.x*weightB.Size.y*weightB.Size.z*1000/61024)/1000
		weightB.CustomPhysicalProperties = PhysicalProperties.new(tdensity,0,0,0,0)
		--Real life mass in kg minus existing roblox mass converted to kg, divided by volume of the weight brick in cubic meters, divided by the density of water
		weightB.CFrame=(car.DriveSeat.CFrame-car.DriveSeat.Position+center)*CFrame.new(0,_Tune.CGHeight,0)

		--Density Cap
		if weightB.CustomPhysicalProperties.Density>=2 then
		warn( "\n\t [AC6C V".._BuildVersion.."]: Density too high for specified volume."
			.."\n\t Current Density:\t"..math.ceil(tdensity)
			.."\n\t Max Density:\t"..math.ceil(weightB.CustomPhysicalProperties.Density)
			.."\n\t Increase weight brick size to compensate.")
		end
	else
		--Existing Weight Is Too Massive
		warn( "\n\t [AC6C V".._BuildVersion.."]: Mass too high for specified weight."
			.."\n\t    Target Mass:\t"..math.ceil((_Tune.Weight*2.205)*8)
			.."\n\t    Current Mass:\t"..math.ceil(mass)
			.."\n\t Reduce part size or axle density to achieve desired weight.")
	end
	
	
	local flipG = Instance.new("BodyGyro",car.DriveSeat)
	flipG.Name = "Flip"
	flipG.D = 0
	flipG.MaxTorque = Vector3.new(0,0,0)
	flipG.P = 0


	