--[[Initialize]]


	script.Parent:WaitForChild("A-Chassis Interface")
	script.Parent:WaitForChild("Plugins")
	script.Parent:WaitForChild("README")
	
	local car=script.Parent.Parent
	local _Tune=require(script.Parent)

	wait(_Tune.LoadDelay)

	--Update Checker
	
	if _Tune.AutoUpdate then
		local newModel 
		local s,m = pcall(function() newModel = game:GetService("InsertService"):LoadAsset(5181235975) end)
		if s then
			local MinorUpdate = false
			local MajorUpdate = false
			local ChassisUpdate = false
			local lChassis = script.Parent["A-Chassis Interface"].Version.Chassis
			local nChassis = newModel["A-Chassis 6C by Novena"]["A-Chassis Tune"]["A-Chassis Interface"].Version:FindFirstChild("Chassis")
			local localVersion = script.Parent["A-Chassis Interface"].Version
			local newVersion = newModel["A-Chassis 6C by Novena"]["A-Chassis Tune"]["A-Chassis Interface"].Version
			if nChassis~=nil then
				if lChassis.Value < nChassis.Value then
					ChassisUpdate = true
				end
			end
			if localVersion.Value < newVersion.Value or localVersion.LastMajorUpdate.Value < newVersion.LastMajorUpdate.Value then
				if localVersion.LastMajorUpdate.Value < newVersion.LastMajorUpdate.Value then
					MajorUpdate = true
				else
					MinorUpdate = true
				end
			end
			if ChassisUpdate then
				print("[AC6C]: Chassis update!"
						.."\nA-Chassis 6C has been updated to "..(nChassis.Value/10).."."
						.."\nThe changes cannot be ported due to the update."
						.."\nYou are advised to update your chassis ASAP.")
			elseif MajorUpdate then
				print("[AC6C]: Major update!"
						.."\nA major update to A-Chassis 6C has been found."
						.."\nThe changes cannot be ported due to the update."
						.."\nYou are advised to update your chassis ASAP.")
			elseif MinorUpdate then
				localVersion.Value = newVersion.Value
				print("[AC6C]: Drive script update!"
					.."\nAn update to A-Chassis' Drive script has been found."
					.."\nThe updated script will take effect next time you get in."
					.."\nYou are advised to update your chassis soon.")
				script.Parent["A-Chassis Interface"].Drive:Destroy()
				newModel["A-Chassis 6C by Novena"]["A-Chassis Tune"]["A-Chassis Interface"].Drive.Parent = script.Parent["A-Chassis Interface"]
			end
			newModel:Destroy()
		end
	end

	--Weight Scaling
	local weightScaling = _Tune.WeightScaling

	local Drive=car.Wheels:GetChildren()
	
	--Remove Existing Mass
	function DReduce(p)
		for i,v in pairs(p:GetChildren())do
			if v:IsA("BasePart") then
				if v.CustomPhysicalProperties == nil then v.CustomPhysicalProperties = PhysicalProperties.new(v.Material) end
				v.CustomPhysicalProperties = PhysicalProperties.new(
					0,
					v.CustomPhysicalProperties.Friction,
					v.CustomPhysicalProperties.Elasticity,
					v.CustomPhysicalProperties.FrictionWeight,
					v.CustomPhysicalProperties.ElasticityWeight
				)
				v.Massless = true --(LuaInt) but it's just this line
			end
			DReduce(v)
		end
	end
	DReduce(car)


