--How to do:
--Put BassParts in body
--And this script in DriverSeat
--Please make sure to have the songMod installed!


if script.Parent:IsA("VehicleSeat") then
	script.Parent.ChildAdded:connect(function(child)
		if child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
			local p= game.Players:GetPlayerFromCharacter(child.Part1.Parent)
			local g= script.SendBass:Clone()
			g.Parent=p.PlayerGui
			g.src.Value = script.BassEvent
			g.Disabled = false	
		end
	end)
	script.Parent.ChildRemoved:Connect(function(child)
		if child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		end
	end)
end

script.BassEvent.OnServerEvent:Connect(function(plr, bass)
	local car = script.Parent.Parent
	local bassParts = car.Body.BassParts
	for i,v in pairs(bassParts:GetChildren()) do
		if v:IsA("MeshPart") then
			local vectorSize = v:FindFirstChild("VectorSize")
			if bass <= v.MaxBassSize.Value then
				v.Size = Vector3.new(vectorSize.Value.X,bass/v.BassSize.Value,vectorSize.Value.Z)
			else
				v.Size = Vector3.new(vectorSize.Value.X,v.MaxBassSize.Value/v.BassSize.Value,vectorSize.Value.Z)
			end
		end
	end
end)
